[Boost-bugs] [Boost C++ Libraries] #11922: Rev f4a61d breaks introduces ambiguity.

Subject: [Boost-bugs] [Boost C++ Libraries] #11922: Rev f4a61d breaks introduces ambiguity.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-01-18 20:58:47


#11922: Rev f4a61d breaks introduces ambiguity.
------------------------------+----------------------------
 Reporter: layus | Owner: johnmaddock
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: multiprecision
  Version: Boost 1.60.0 | Severity: Regression
 Keywords: |
------------------------------+----------------------------
 The following code used to work before 1.60.

 {{{
 #include <memory>
 #include <boost/multiprecision/cpp_int.hpp>
 typedef boost::multiprecision::cpp_int mp_int;

 class Int {
   public:
     Int(const mp_int& i) {};
     Int(const Int& i) = delete;
 };

 int main() {
     mp_int i(10);
     std::shared_ptr<Int> p = std::make_shared<Int>(i + 10);
     return 0;
 }
 }}}

 But the changes introduced by the following commit, merged into
 boost-1.60.0, breaks it.
 The compiler cannot pick the constructor because there is some ambiguity.
 (i.e. "call of overloaded ‘Int(...)’ is ambiguous")

 {{{
 commit f4a61d5f47c4b03e2c0d3f2bed55fe8f7bb07620
 Author: jzmaddock <XXX>
 Date: Thu Mar 12 17:55:13 2015 +0000

     Add explicit conversion operators and tests to expression templates.

 }}}

 I must admit I am not even sure why there is ambiguity, but since the only
 way to call Int(const Int&) is to call Int(const mp_int&) first to get an
 Int there should be no ambiguity for the compiler here.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11922>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:19 UTC