This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53836] New: ICE: unexpected expression of kind template_parm_index
- From: "roger.ferrer at bsc dot es" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 03 Jul 2012 08:23:25 +0000
- Subject: [Bug c++/53836] New: ICE: unexpected expression of kind template_parm_index
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53836
Bug #: 53836
Summary: ICE: unexpected expression of kind template_parm_index
Classification: Unclassified
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: roger.ferrer@bsc.es
Created attachment 27733
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27733
Preprocessed source
Hello,
the following testcase fails to compile in g++ 4.7.1
// -- test.cc
template <int N>
struct A { };
template <int Q>
void g()
{
const int M ( Q );
A<M> a;
}
void h()
{
g<3>();
}
$ g++ -c test.cc
test.cc: In function âvoid g()â:
test.cc:9:8: internal compiler error: unexpected expression âQâ of kind
template_parm_index
Please submit a full bug report,
with preprocessed source if appropriate.
Preprocessed source stored into /tmp/cc7IeEc0.out file, please attach this to
your bugreport.
Using 'const int M = Q;' instead works fine.
g++ 4.4 and g++ 4.5 fail (without an ICE), but g++ 4.6.3 works fine so it looks
to me as a 4.7 regression.
Kind regards,