The following code causes an ICE: ============ test.cc ============= struct B {}; struct A { A( B ); }; struct Bar { template< unsigned v > struct Foo { A z = B(); unsigned value; Foo(): value( v ) {} }; struct Baz { Foo< 8 > foo1; Foo< 1 > foo3; }; }; Bar::Baz baz; =============================== $ g++-4.8 -c -std=c++11 test.cc test.cc: In constructor ‘Bar::Foo<v>::Foo() [with unsigned int v = 1u]’: test.cc:14:21: internal compiler error: in gimple_add_tmp_var, at gimplify.c:738 Foo(): value( v ) {} ^ ... P.S. This might possibly be related to bug 58187.
Hm, I can't seem to reproduce it. Is this vanilla gcc?
I can reproduce it, though with checking compilers the ICE is usually much earlier (pt.c or so). ICEs from around r179155 or so when NSDMIs were implemented, so not sure we can consider it a regression.
This is also fixed in mainline. I'm adding the testcase and closing the bug.
Author: paolo Date: Fri Nov 15 23:51:23 2013 New Revision: 204881 URL: http://gcc.gnu.org/viewcvs?rev=204881&root=gcc&view=rev Log: 2013-11-15 Paolo Carlini <paolo.carlini@oracle.com> PR c++/58188 * g++.dg/cpp0x/nsdmi-template8.C: New. 2013-11-15 Paolo Carlini <paolo.carlini@oracle.com> PR c++/58725 * g++.dg/cpp0x/nsdmi-template7.C: New. 2013-11-15 Paolo Carlini <paolo.carlini@oracle.com> PR c++/58829 * g++.dg/cpp0x/nsdmi-template6.C: New. Added: trunk/gcc/testsuite/g++.dg/cpp0x/nsdmi-template6.C trunk/gcc/testsuite/g++.dg/cpp0x/nsdmi-template7.C trunk/gcc/testsuite/g++.dg/cpp0x/nsdmi-template8.C Modified: trunk/gcc/testsuite/ChangeLog
Done.