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: unassig...@gcc.gnu.org ReportedBy: roger.fer...@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,