This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16964] New: [3.4/3.5 regression] ICE in cp_parser_class_specifier when specializing after use
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Aug 2004 14:10:41 -0000
- Subject: [Bug c++/16964] New: [3.4/3.5 regression] ICE in cp_parser_class_specifier when specializing after use
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
This little piece of code, extracted from PR 16934, ICEs the
compiler (note that the code is, of course, invalid):
-----------------
struct X {
template<typename> struct Y { typedef int type; };
typedef Y<int>::type type;
};
template<> struct X::Y<int> { typedef int type; };
-----------------
g/x> /home/bangerth/bin/gcc-3.5-pre/bin/c++ -c a.cc
a.cc:6: error: specialization of `X::Y<int>' after instantiation
a.cc:6: error: redefinition of `struct X::Y<int>'
a.cc:2: error: previous definition of `struct X::Y<int>'
a.cc:6: internal compiler error: tree check: expected class 't', have
'x' (error_mark) in cp_parser_class_specifier, at cp/parser.c:12371
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
This ICE is a regression in 3.4 and mainline against previous versions.
W.
--
Summary: [3.4/3.5 regression] ICE in cp_parser_class_specifier
when specializing after use
Product: gcc
Version: 3.4.1
Status: UNCONFIRMED
Keywords: ice-on-invalid-code, error-recovery
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bangerth at dealii dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16964