This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13156] New: Greedy instantiation
- From: "dave at boost-consulting dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Nov 2003 18:40:09 -0000
- Subject: [Bug c++/13156] New: Greedy instantiation
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following fails to compile, but shouldn't. You can see this by replacing
the body of X's constructor with ";", which will cause compilation to succeed.
------
struct X
{
template <class T>
X(T const&) { T x = 1; }
};
template <class From, class To>
struct conv
{
static char (& _m_check(...) )[2];
static char _m_check(To);
static From _m_from;
enum {
value = sizeof( _m_check(_m_from) ) == 1
};
};
int x[conv<char*,X>::value ? 1 : -1];
--
Summary: Greedy instantiation
Product: gcc
Version: 3.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dave at boost-consulting dot com
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13156