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++/40685] explicit constructor is used where only implicit ctors are allowed



------- Comment #2 from bangerth at gmail dot com  2009-08-25 14:39 -------
Hm, confusing:
-----------------------------
enum E {e};

struct A {
    A(int);
    explicit A(E) {};
};

int main () { A a = e; }
-----------------------------
This compiles but not links becase A::A(int) is called. If I remove
the explicit keyword, it calls A::A(E) and links fine. I must admit
that I don't know whether that's correct. icc concurs with gcc, by the way.

W.


-- 

bangerth at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bangerth at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40685


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