Bug 128987 - internal compiler error with namespaces
internal compiler error with namespaces
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-08-02 15:07 EDT by Siddhartha
Modified: 2007-11-30 17:10 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-05 16:59:29 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Siddhartha 2004-08-02 15:07:59 EDT
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 16:26:38 EDT
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 10:38:31 EDT
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 16:59:29 EDT
Fixed in 3.4.

Note You need to log in before you can comment on or make changes to this bug.