Bug 36083

Summary: g++ segfault
Product: gcc Reporter: Pontus Astrom <pontus.astrom>
Component: c++Assignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: gcc-bugs
Priority: P3    
Version: 4.1.1   
Target Milestone: 4.1.2   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed:

Description Pontus Astrom 2008-04-30 07:21:25 UTC
The compiler exits with segmentation fault for this source file. There are errors in the syntax but this still should not result in a segfault.

Begin code ---------------------

namespace a
{
   struct exception_base
   {
	 virtual ~exception_base() throw();
   };
}

a::~exception_base() throw(){}

End code --------------------------------


Command line: 
> g++ -v -c -o bug.o bug.cc -save-temps

Output:
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.1.1/configure --prefix=/opt/gcc/4.1.1
Thread model: posix
gcc version 4.1.1
 /opt/gcc/4.1.1/libexec/gcc/i686-pc-linux-gnu/4.1.1/cc1plus -E -quiet -v -D_GNU_SOURCE bug.cc -mtune=pentiumpro -fpch-preprocess -o bug.ii
ignoring duplicate directory "/usr/local/include"
ignoring nonexistent directory "/opt/gcc/4.1.1/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../../i686-pc-linux-gnu/include"
ignoring duplicate directory "/usr/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/include
 /usr/X11/include
 /opt/gcc/4.1.1/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../../include/c++/4.1.1
 /opt/gcc/4.1.1/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../../include/c++/4.1.1/i686-pc-linux-gnu
 /opt/gcc/4.1.1/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../../include/c++/4.1.1/backward
 /opt/gcc/4.1.1/include
 /opt/gcc/4.1.1/lib/gcc/i686-pc-linux-gnu/4.1.1/include
End of search list.
 /opt/gcc/4.1.1/libexec/gcc/i686-pc-linux-gnu/4.1.1/cc1plus -fpreprocessed bug.ii -quiet -dumpbase bug.cc -mtune=pentiumpro -auxbase-strip bug.o -version -o bug.s
GNU C++ version 4.1.1 (i686-pc-linux-gnu)
        compiled by GNU C version 4.0.2 20050901 (prerelease) (SUSE Linux).
GGC heuristics: --param ggc-min-expand=98 --param ggc-min-heapsize=128290
Compiler executable checksum: 15f7450715807b4e1d2bded670d0f376
bug.cc:9: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Richard Biener 2008-04-30 10:24:13 UTC
g++-4.1 -S t.C
t.C:9: error: scope 'a' before '~' is not a class-name

works for me since 4.1.2.