This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/40685] explicit constructor is used where only implicit ctors are allowed
- From: "bangerth at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Aug 2009 14:39:25 -0000
- Subject: [Bug c++/40685] explicit constructor is used where only implicit ctors are allowed
- References: <bug-40685-17603@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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