This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/43509] New: ICE: in constructor_name_p, at cp/name-lookup.c:1809 with invalid code in c++0x mode
- From: "zsojka at seznam dot cz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Mar 2010 16:33:51 -0000
- Subject: [Bug c++/43509] New: ICE: in constructor_name_p, at cp/name-lookup.c:1809 with invalid code in c++0x mode
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Command line:
g++ -std=c++0x testcase.cpp
---- testcase.cpp ----
template < typename > struct A { A(); };
typedef A <> B;
template <> B::A() {}
----------------------
trunk (with checking) gives:
$ /mnt/svn/gcc-trunk/binary-157675-lto/bin/g++ -std=c++0x testcase.cpp
testcase.cpp:2:12: error: wrong number of template arguments (0, should be 1)
testcase.cpp:1:30: error: provided for 'template<class> struct A'
testcase.cpp:2:15: error: invalid type in declaration before ';' token
testcase.cpp:3:16: internal compiler error: in constructor_name_p, at
cp/name-lookup.c:1809
trunk (without checking) gives:
$ g++-4.5.0-alpha20100318 -std=c++0x testcase.cpp
testcase.cpp:2:12: error: wrong number of template arguments (0, should be 1)
testcase.cpp:1:30: error: provided for 'template<class> struct A'
testcase.cpp:2:15: error: invalid type in declaration before ';' token
testcase.cpp:3:18: error: ISO C++ forbids declaration of 'A' with no type
testcase.cpp:3:18: error: 'int' is not a class or a namespace
testcase.cpp:3:18: error: 'A' is not a template function
4.4 (with checking) gives:
$ /mnt/svn/gcc-4_4/binary-157395-enable-checking/bin/g++ -std=c++0x
testcase.cpp
testcase.cpp:2: error: wrong number of template arguments (0, should be 1)
testcase.cpp:1: error: provided for 'template<class> struct A'
testcase.cpp:2: error: invalid type in declaration before ';' token
testcase.cpp:3: error: 'B' is not a class type
testcase.cpp:3: error: 'B' is not a class type
testcase.cpp:3: error: 'B' is not a class type
testcase.cpp:3: error: ISO C++ forbids declaration of 'A' with no type
testcase.cpp:3: error: 'int' is not a class or a namespace
testcase.cpp:3: error: 'A' is not a template function
Diagnostics look too complicated, given the problem is wrong number of template
parameters.
--
Summary: ICE: in constructor_name_p, at cp/name-lookup.c:1809
with invalid code in c++0x mode
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: zsojka at seznam dot cz
GCC host triplet: x86_64-pc-linux-gnu
GCC target triplet: x86_64-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43509