Internal error: Segmentation fault in g++ 3.0
>Submitter-Id: ?
>Originator: Franck Branjonneau
>Organization:
>Confidential: no
>Synopsis: GCC gives an ICE instead of reporting an error.
>Severity: non-critical
>Priority: ?
>Category: c++
>Class: ice-on-illegal-code
>Release: 3.0 (Debian) (Debian testing/unstable)
>Environment:
System: Linux alpha.tchume.net 2.4.4 #2 mar mai 22 08:16:07 CEST 2001 i586 unknown
Architecture: i586
host: i386-pc-linux-gnu
build: i386-pc-linux-gnu
target: i386-pc-linux-gnu
configured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,objc --prefix=/usr --infodir=/share/info --mandir=/share/man --enable-shared --with-gnu-as --with-gnu-ld --with-system-zlib --enable-long-long --enable-nls --without-x --without-included-gettext --disable-checking --enable-threads=posix --enable-java-gc=boehm --with-cpp-install-dir=bin --enable-objc-gc i386-linux
>Description:
When compiling this:
template< int a, bool spin >
class Dummy {};
namespace A0 {
template< bool spin >
class Dummy {
};
}
template<>
class Dummy< 0, true >: public A0::Dummy< true > {
public:
Dummy(): A0::Dummy() {}
};
I got, from codesourcery:
GCC Output
These are the results of processing your source code with the following command:
g++ [input]
Exit code: 256
Messages:
/usr/tmp/@27613.7.cc: In constructor `Dummy<0, true>::Dummy()':
/usr/tmp/@27613.7.cc:14: Internal error: Segmentation fault
>How-To-Repeat:
>Fix:
Fix the source:
template<>
class Dummy< 0, true >: public A0::Dummy< true > {
public:
// Wrong: /Dummy(): A0::Dummy() {}/, now
Dummy(): A0::Dummy< true >() {}
};
Reply to: