Bug 9829 - [3.2 regression] Missing colon in nested namespace usage causes ICE
Summary: [3.2 regression] Missing colon in nested namespace usage causes ICE
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2003-02-24 12:56 UTC by andrew.carson
Modified: 2003-07-25 17:33 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description andrew.carson 2003-02-24 12:56:00 UTC
The following (illegal) code snippet causes an ICE under gcc-3.2.3-20030222 and gcc-3.3-20030222

ice.cxx:
--------------------------------------
namespace a {
    namespace b {
        void foo();
    }
}

void
a::b:foo()
{
}
---------------------------

% g++32 ice.cxx
ice.cxx:8: `a::b' as declarator
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

% g++33 ice.cxx
ice.cxx:8: internal compiler error: in grokdeclarator, at cp/decl.c:10394
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

Whereas gcc-3.4-20030222 and gcc-3.0.x 'work'

% g++34 ice.cxx
ice.cxx:8: error: invalid function declaration

% g++30 ice.cxx
ice.cxx:8: `a::b' as declarator (compiler error)
ice.cxx:8: syntax error before `:' token

[ Seems to occur on both an ix86 machine and a Sun Sparc machine... ]

Release:
unknown

Environment:
gcc-3.2.3-20030222
gcc-3.3-20030222
Comment 1 andrew.carson 2003-02-24 12:56:00 UTC
Fix:
Fixed in GCC 3.3 with:

http://gcc.gnu.org/ml/gcc-patches/2003-02/msg02218.html
Comment 2 Wolfgang Bangerth 2003-02-24 15:33:46 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: Confirmed. A regression in 3.2 and 3.3, but fixed in 3.4
Comment 3 Mark Mitchell 2003-02-26 05:24:17 UTC
From: mmitchel@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/9829
Date: 26 Feb 2003 05:24:17 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_3-branch
 Changes by:	mmitchel@gcc.gnu.org	2003-02-26 05:24:17
 
 Modified files:
 	gcc/cp         : ChangeLog decl.c 
 	gcc/testsuite  : ChangeLog 
 Added files:
 	gcc/testsuite/g++.dg/parse: namespace1.C 
 
 Log message:
 	PR c++/9829
 	* decl.c (grokdeclarator): Handle SCOPE_REFs whose second argument
 	is a NAMESPACE_DECL.
 	
 	PR c++/9829
 	* g++.dg/parse/namespace1.C: New test.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3076.2.47&r2=1.3076.2.48
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.965.2.17&r2=1.965.2.18
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.65&r2=1.2261.2.66
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/namespace1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.12.1
 

Comment 4 Mark Mitchell 2003-02-26 05:24:17 UTC
From: mmitchel@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/9829
Date: 26 Feb 2003 05:24:17 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_3-branch
 Changes by:	mmitchel@gcc.gnu.org	2003-02-26 05:24:17
 
 Modified files:
 	gcc/cp         : ChangeLog decl.c 
 	gcc/testsuite  : ChangeLog 
 Added files:
 	gcc/testsuite/g++.dg/parse: namespace1.C 
 
 Log message:
 	PR c++/9829
 	* decl.c (grokdeclarator): Handle SCOPE_REFs whose second argument
 	is a NAMESPACE_DECL.
 	
 	PR c++/9829
 	* g++.dg/parse/namespace1.C: New test.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3076.2.47&r2=1.3076.2.48
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.965.2.17&r2=1.965.2.18
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.65&r2=1.2261.2.66
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/namespace1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.12.1
 

Comment 5 Mark Mitchell 2003-02-26 05:26:50 UTC
From: mmitchel@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/9829
Date: 26 Feb 2003 05:26:50 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	mmitchel@gcc.gnu.org	2003-02-26 05:26:50
 
 Modified files:
 	gcc/testsuite  : ChangeLog 
 Added files:
 	gcc/testsuite/g++.dg/parse: namespace6.C 
 
 Log message:
 	PR c++/9829
 	* g++.dg/parse/namespace6.C: New test.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2446&r2=1.2447
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/namespace6.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
 
Comment 6 Joe Buck 2003-04-25 20:18:38 UTC
State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed for 3.3.