First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 8906
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: Not yet assigned to anyone <unassigned@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: Wirawan Purwanto <wirawan0@gmail.com>
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
gcc-3.2-bugs.nested-class-decl.txt gcc-3.2-bugs.nested-class-decl.txt application/octet-stream 2003-05-21 15:16 1.88 KB Edit
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 8906 depends on: Show dependency tree
Show dependency graph
Bug 8906 blocks:

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: Opened: 2002-12-11 16:06
Brief:   <Segmentation fault> happens in G++ version 3.2 when parsing the
definition of a nested class definition, if the "outer" class is a templatized
class.

This problem is also-reproducible in SunSPARC and Win32's version of GCC 3.2

Release:
g++ version 3.2

Environment:
Linux (Redhat 7.3) or Windows 2000 (cygwin) or SunSPARC machine (running
Solaris)

How-To-Repeat:
Please take a look at the attachment for more details. It contains a small
piece of code to trigger the error. In brief, try to compile the following:

template <class _stuff>
class CLASS1
{
    class Nested1
    {
        class Nested2;
    };
};

template <class _stuff>
class CLASS1<_stuff>::Nested1::Nested2 // <--error here!!!
{
public:
    int x;
};

/* NOTE: it turns out that the same problem occurs if the outermost class is an
ordinary class (not templatized) */

------- Comment #1 From Wirawan Purwanto 2002-12-11 16:06 -------
Fix:
Fixed in GCC 3.3 with:

http://gcc.gnu.org/ml/gcc-patches/2003-02/msg01856.html

------- Comment #2 From Wolfgang Bangerth 2002-12-11 17:18 -------
State-Changed-From-To: open->analyzed
State-Changed-Why: Confirmed. It used to work until 3.0, but fails with 3.2
    and 3.3. Here's the code:
    ---------------------
    template <class T> class CO {
        class CI1 {
            class CI2;
        };
    };
    
    template <class T>
    class CO<T>::CI1::CI2 {};
    ---------------------
    
    Using my GNU-compiler-collection, I see that this regression
    has been introduced in the first half of July:
    ../bin/gcc-2002-06-15 +
    ../bin/gcc-2002-07-01 +
    ../bin/gcc-2002-07-15 X
    ../bin/gcc-2002-08-01 X

------- Comment #3 From janis187@us.ibm.com 2002-12-12 17:40 -------
From: Janis Johnson <janis187@us.ibm.com>
To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, wirawan0@softhome.net,
   gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org, jason@redhat.com
Cc:  
Subject: Re: c++/8906: [3.2/3.3 regression] segmentation fault when parsing 
 nested-class definition
Date: Thu, 12 Dec 2002 17:40:03 -0800

 The mainline regression reported in PR c++/8906 showed up
 starting with this patch, which might merely uncover an
 existing problem:
 
 >2002-07-10  Jason Merrill  <jason@redhat.com>
 >
 >       PR c++/6255
 >       * decl.c (lookup_name_real): Build a new TYPENAME_TYPE rather
 than
 >       modifying the old one.
 
 I used the small test case that Wolfgang provided.  The ICE
 occurs in the mainline, the 3.2 branch, 3.2.1, 3.2, and
 3.1.1, but not 3.1.
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8906
 
 
 


------- Comment #4 From Jeffrey D. Oldham 2003-01-10 11:20 -------
From: Jeffrey Oldham <oldham@codesourcery.com>
To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, wirawan0@softhome.net,
   gcc-bugs@gcc.gnu.org
Cc:  
Subject: Re: c++/8906: [3.2/3.3/3.4 regression] segmentation fault when parsing
 nested-class definition
Date: Fri, 10 Jan 2003 11:20:36 -0800

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8906
 
 This problem has been resolved for gcc 3.4, i.e., the CVS head version. 
   It remains open for gcc 3.3.
 
 Jeffrey D. Oldham
 oldham@codesourcery.com
 


------- Comment #5 From Volker Reichelt 2003-03-10 12:55 -------
From: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
To: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, wirawan0@softhome.net
Cc:  
Subject: Re: c++/8906: [3.2 regression] segmentation fault when parsing
 nested-class definition
Date: Mon, 10 Mar 2003 12:55:19 +0100 (CET)

 Just for the record:
 
 The problem seems to be fixed on the 3.3 branch (as well as on
 mainline). It just remains open on the 3.2 branch.
 
 Regards,
 Volker
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8906
 
 

------- Comment #6 From Joe Buck 2003-04-25 20:06 -------
State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed for 3.3.

First Last Prev Next    No search results available      Search page      Enter new bug