Bug 128987

Summary: internal compiler error with namespaces
Product: [Fedora] Fedora Reporter: Siddhartha <reddy>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 1CC: redhat-bugzilla
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-05 20:59:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Siddhartha 2004-08-02 19:07:59 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1)
Gecko/20031030

Description of problem:
gcc 3.3.2 gives an internal compiler error on the following
preprocessed minimal code while it should just have given a name
conflict error. The error is

test.C:16: internal compiler error: in resume_binding_level, at
cp/decl.c:831
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccwNxp47.out file, please attach
this to your bugreport

The preprocessed code is:    

namespace hi {
        namespace hello {
 
        }
}
 
using hi::hello;
 
namespace hello {
 
}
 
int main ()
{
 
}

Version-Release number of selected component (if applicable):
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--disable-checking --with-system-zlib --enable-__cxa_atexit
--host=i386-redhat-linux Thread model: posix gcc version 3.3.2
20031022 (Red Hat Linux 3.3.2-1)

How reproducible:
Always

Steps to Reproduce:
1.g++ -g test.C // assuming the file was named test.C
2.
3.
    

Actual Results:  gives an internal compiler error

Expected Results:  a name conflict error should have been given.

Additional info:

Comment 1 Robert Scheck 2004-08-02 20:26:38 UTC
I think, the problem is that you named the file *.c not *.cpp for 
g++. I had the same problem with cygwin and mingw gcc and wondered,
that there were problems with files named *.cpp.

Try to rename the file to *.cpp and I think, you'll not get that 
problem again.

Comment 2 Benjamin Kosnik 2004-10-01 14:38:31 UTC
Confirmed bug with gcc-3.3.x, fixed in gcc-3.4.x

gcc-3.3.3
%g++ -c ns.cc
ns.cc:9: internal compiler error: in resume_binding_level, at
cp/decl.c:831
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccoIrgqx.out file, please attach
this to your bugreport
<bkoz@roscoe> /home/bkoz %g++ --version
g++ (GCC) 3.3.2 20031022 (Red Hat Linux 3.3.2-1)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

gcc-3.4.x
%COMP.sh "-c" ns.cc
ns.cc:7: error: namespace `hi::hello' not allowed in using-declaration


Comment 3 Richard Henderson 2004-10-05 20:59:29 UTC
Fixed in 3.4.