The following invalid testcase triggers an ICE since GCC 4.0.0: ============================================= template<int> struct A { typedef int T; void foo(); }; template<int N> void A<N>::T::foo() {} ============================================= bug.cc:7: internal compiler error: in is_ancestor, at cp/name-lookup.c:2250 Please submit a full bug report, [etc.]
Related to PR 27102.
Confirmed.
Won't fix in GCC-4.0.x. Adjusting milestone.
On it.
Humm, too tricky.
Closing 4.1 branch.
I think I have a simple fix.
I found the same fix earlier and submitted a patch but forgot to update the PR which is probably why you didn't notice it. http://gcc.gnu.org/ml/gcc-patches/2008-12/msg00663.html My patch doesn't check for namespace (just class) so I think your patch is better.
Subject: Bug 29388 Author: pinskia Date: Thu Jan 15 22:10:24 2009 New Revision: 143411 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143411 Log: 2009-01-15 Andrew Pinski <andrew_pinski@playstation.sony.com> PR C++/29388 * decl.c (grokdeclarator): Check for a non namespace/class context. 2009-01-15 Andrew Pinski <andrew_pinski@playstation.sony.com> PR C++/29388 * g++.dg/template/error37.C: New testcase. Added: trunk/gcc/testsuite/g++.dg/template/error37.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/decl.c trunk/gcc/testsuite/ChangeLog
Fixed on the trunk.
Closing 4.2 branch.
I am no longer working on this one.
It looks like you already fixed it on the mainline, is there a reason the patch can't be backported to the 4.3 branch and the defect closed?
This bug is fixed for 4.4.0 and later releases but it was decided not to fix it for the 4.3 branch. See http://gcc.gnu.org/ml/gcc-patches/2009-04/msg01275.html
*** Bug 42071 has been marked as a duplicate of this bug. ***