This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11672] New: ICE on template instantiation in erroneous source.
- From: "duz at sol-3 dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Jul 2003 14:03:30 -0000
- Subject: [Bug c++/11672] New: ICE on template instantiation in erroneous source.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11672
Summary: ICE on template instantiation in erroneous source.
Product: gcc
Version: 3.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: duz at sol-3 dot de
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i386-unknown-freebsd4.8
GCC host triplet: i386-unknown-freebsd4.8
GCC target triplet: i386-unknown-freebsd4.8
The following snippet of erroneous source code crashes the
gcc-3.3 compiler. I tried on various systems. It seems to
crash on x86 and sparc, and to issue the proper error message:
bumm.cc: In constructor `A<T>::A() [with T = void]':
bumm.cc:9: instantiated from here
bumm.cc:6: `void' is not an aggregate type
on PowerPC based systems.
--------------------------------------
template <class T>
class A
{
int n;
public:
A() : n (T::foo()) {}
};
A<void> a;
-------------------------------------
Here is a run on my FreeBSD system. This specific compiler was
bootstrapped with
BOOT_CFLAGS="-pipe -O2 -fomit-frame-pointer -mpreferred-stack-boundary=2
-march=athlon-tbird"
merkur:~/cc/tmp$ gcc -v -S bumm.cc
Reading specs from /opt/gnu/bin/../lib/gcc-lib/i386-unknown-freebsd4.8/3.3/specs
Configured with: /pub/unpacked/gcc-3.3/configure --prefix=/opt/gnu/gcc-3.3
--disable-shared
Thread model: posix
gcc version 3.3
/opt/gnu/bin/../lib/gcc-lib/i386-unknown-freebsd4.8/3.3/cc1plus -quiet -v
-iprefix /opt/gnu/bin/../lib/gcc-lib/i386-unknown-freebsd4.8/3.3/ -D__GNUC__=3
-D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=0 bumm.cc -D__GNUG__=3 -quiet -dumpbase
bumm.cc -auxbase bumm -version -o bumm.s
GNU C++ version 3.3 (i386-unknown-freebsd4.8)
compiled by GNU C version 3.3.
GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=65137
ignoring nonexistent directory
"/opt/gnu/lib/gcc-lib/../../i386-unknown-freebsd4.8/include"
ignoring nonexistent directory "/opt/gnu/gcc-3.3/i386-unknown-freebsd4.8/include"
ignoring duplicate directory "/opt/gnu/gcc-3.3/include/c++/3.3"
ignoring duplicate directory
"/opt/gnu/gcc-3.3/include/c++/3.3/i386-unknown-freebsd4.8"
ignoring duplicate directory "/opt/gnu/gcc-3.3/include/c++/3.3/backward"
ignoring duplicate directory
"/opt/gnu/gcc-3.3/lib/gcc-lib/i386-unknown-freebsd4.8/3.3/include"
#include "..." search starts here:
#include <...> search starts here:
/opt/gnu/lib/gcc-lib/../../include/c++/3.3
/opt/gnu/lib/gcc-lib/../../include/c++/3.3/i386-unknown-freebsd4.8
/opt/gnu/lib/gcc-lib/../../include/c++/3.3/backward
/opt/gnu/lib/gcc-lib/i386-unknown-freebsd4.8/3.3/include
/usr/local/include
/opt/gnu/gcc-3.3/include
/usr/include
End of search list.
bumm.cc: In constructor `A<T>::A() [with T = void]':
bumm.cc:9: instantiated from here
bumm.cc:6: 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.
merkur:~/cc/tmp$