This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/36183] misleading error message with explicit copy constructor call


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36183

Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-05-30
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |manu at gcc dot gnu.org
     Ever confirmed|0                           |1
           Severity|trivial                     |normal

--- Comment #1 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> ---
It seems to me that the problem is the "explicit" keyword, so an error like:

test.cc:14:6: error: no matching function for call to âB::B(const B&)â
   f(b); // error: no matching function for call to 'B::B(const B&)'
      ^
test.cc:4:3: note: candidate: 'explicit B::B(const B&)'
   B() {}
   ^
test.cc:4:3: note:   is marked as explicit but implicit conversion required
test.cc:8:6: note:   initializing argument 1 of âvoid f(B)â
 void f(B obj) {}
      ^

Jason?

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]