Since r243723 we ICE on the following testcase: template <typename> struct A; template <typename = A<int>> class B {}; template <class T, class U, class V> void foo (U, V) { T (0, 0); } struct C {}; template <template <bool, bool, bool> class F, class> void bar () { F<0, 0, 0>::baz; } struct G { int l; }; template <int, int, int> struct E : C { E (int, int) : e (0) { auto &m = this->m (); auto c = [&] { m.l; }; } G &m (); int e; }; struct D { void baz () { bar<F, B<>>; } template <bool, bool, bool> struct F { static B<> baz () { foo<E<0, 0, 0>> (0, 0); } }; }; reduced from mathicgb: src/mathicgb/ModuleMonoSet.cpp:184:1: required from here src/mathicgb/ModuleMonoSet.cpp:71:34: internal compiler error: in tsubst_copy, at cp/pt.c:14400 const auto& monoid = this->monoid(); // workaround for gcc 4.5.3 issue ~~~~~~^~~~~~
Author: nathan Date: Tue Jan 31 18:05:37 2017 New Revision: 245067 URL: https://gcc.gnu.org/viewcvs?rev=245067&root=gcc&view=rev Log: PR c++/67273 PR c++/79253 * pt.c: (instantiate_decl): Push to top level when current function scope doesn't match. Only push lmabda scope stack when pushing to top. PR c++/67273 PR c++/79253 * g++.dg/cpp1y/pr67273.C: New. * g++.dg/cpp1y/pr79253.C: New. Added: trunk/gcc/testsuite/g++.dg/cpp1y/pr67273.C trunk/gcc/testsuite/g++.dg/cpp1y/pr79253.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/pt.c trunk/gcc/testsuite/ChangeLog
Fixed r245067.