This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51661] New: ICE when template class list repeated
- From: "cas43 at cs dot stanford.edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 23 Dec 2011 06:45:22 +0000
- Subject: [Bug c++/51661] New: ICE when template class list repeated
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51661
Bug #: 51661
Summary: ICE when template class list repeated
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: cas43@cs.stanford.edu
g++ crashes when compiling this program:
namespace
{
template<class T> struct s{s();};
template<class T> s<T><T>::s(){}
extern template struct s<int>;
}
How to run: g++ prog.cpp
Output:
prog.cpp:4:19: error: â{anonymous}::s<T>â is not a template
prog.cpp:4:30: error: declaration of â{anonymous}::s<T> s()â not in a namespace
surrounding â::â
prog.cpp:4:30: error: â{anonymous}::s<T> s()â should have been declared inside
â::â
prog.cpp:5:24: error: using typedef-name âs<int>â after âstructâ
prog.cpp:5:24: internal compiler error: tree check: expected tree that contains
âdecl minimalâ structure, have âtemplate_id_exprâ in
check_elaborated_type_specifier, at cp/decl.c:11443
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Compiler version:
COLLECT_GCC=/new-gcc/i-4.7/bin/g++
COLLECT_LTO_WRAPPER=/new-gcc/i-4.7/libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../s-4.7/configure --prefix=/new-gcc/i-4.7
Thread model: posix
gcc version 4.7.0 20111223 (experimental) (GCC)