Bug 29388 - [4.3 regression] ICE with invalid nested name specifier
Summary: [4.3 regression] ICE with invalid nested name specifier
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.2.0
: P4 normal
Target Milestone: 4.4.0
Assignee: Not yet assigned to anyone
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: ice-on-invalid-code, monitored, patch
: 42071 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-10-08 20:16 UTC by Volker Reichelt
Modified: 2009-11-16 22:02 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work: 3.4.6 4.4.0
Known to fail: 4.0.4 4.1.0 4.1.1 4.1.2 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.3.0 4.3.1
Last reconfirmed: 2009-01-02 21:13:31


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2006-10-08 20:16:22 UTC
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.]
Comment 1 Andrew Pinski 2006-10-08 20:31:11 UTC
Related to PR 27102.
Comment 2 Richard Biener 2006-10-12 08:13:20 UTC
Confirmed.
Comment 3 Gabriel Dos Reis 2007-02-03 20:31:03 UTC
Won't fix in GCC-4.0.x.  Adjusting milestone.
Comment 4 Paolo Carlini 2007-09-02 23:00:49 UTC
On it.
Comment 5 Paolo Carlini 2007-09-02 23:29:29 UTC
Humm, too tricky.
Comment 6 Joseph S. Myers 2008-07-04 21:36:23 UTC
Closing 4.1 branch.
Comment 7 Andrew Pinski 2009-01-02 21:06:37 UTC
I think I have a simple fix.
Comment 8 Andrew Pinski 2009-01-02 21:06:44 UTC
I think I have a simple fix.
Comment 9 Steve Ellcey 2009-01-05 18:46:04 UTC
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.
Comment 10 Andrew Pinski 2009-01-15 22:10:36 UTC
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

Comment 11 Andrew Pinski 2009-01-15 22:11:29 UTC
Fixed on the trunk.
Comment 12 Joseph S. Myers 2009-03-31 19:47:49 UTC
Closing 4.2 branch.
Comment 13 Andrew Pinski 2009-04-16 15:44:31 UTC
I am no longer working on this one.
Comment 14 Steve Ellcey 2009-04-16 15:48:59 UTC
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?
Comment 15 Steve Ellcey 2009-04-20 16:12:55 UTC
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
Comment 16 Paolo Carlini 2009-11-16 22:02:27 UTC
*** Bug 42071 has been marked as a duplicate of this bug. ***