This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/57942] g++-4.8.1 tries to instantiate wrong constructor (C++11)
- From: "richard-gccbugzilla at metafoo dot co.uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 20 Jul 2013 22:12:04 +0000
- Subject: [Bug c++/57942] g++-4.8.1 tries to instantiate wrong constructor (C++11)
- Auto-submitted: auto-generated
- References: <bug-57942-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57942
Richard Smith <richard-gccbugzilla at metafoo dot co.uk> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |richard-gccbugzilla@metafoo
| |.co.uk
--- Comment #1 from Richard Smith <richard-gccbugzilla at metafoo dot co.uk> ---
Reduced to:
template<typename T> struct S { typename T::error type; };
struct X {};
void f(S<int> *);
void f(...);
void g() { f((X*)0); }
It looks like, when considering a conversion from A* to B*, where A is a class
type, gcc attempts to complete B. There seems to be no obvious justification
for this (it doesn't help in determining whether B is a base class of A, which
seems like the most likely explanation for this behavior).