This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/8736: internal compile error at a typedef to a typedef in a template sub struct of a template struct from a template function
- From: pkolloch at gmx dot net
- To: gcc-gnats at gcc dot gnu dot org
- Date: 27 Nov 2002 18:27:59 -0000
- Subject: c++/8736: internal compile error at a typedef to a typedef in a template sub struct of a template struct from a template function
- Reply-to: pkolloch at gmx dot net
>Number: 8736
>Category: c++
>Synopsis: internal compile error at a typedef to a typedef in a template sub struct of a template struct from a template function
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: ice-on-legal-code
>Submitter-Id: net
>Arrival-Date: Wed Nov 27 10:36:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Peter Kolloch
>Release: gcc version 3.2.1
>Organization:
>Environment:
Kernel: Vanilla Linux 2.4.19-686
Distribution: Debian sid
Full output of g++-3.2 -v:
Reading specs from /usr/lib/gcc-lib/i386-linux/3.2.1/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,pascal,objc,ada --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.2 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-java-gc=boehm --enable-objc-gc i386-linux
Thread model: posix
gcc version 3.2.1
>Description:
The compilater crashes at the second typedef in the following code:
template <typename T>
struct A
{
template <typename T2>
struct GetType
{
typedef int blupps;
};
};
template <typename T>
void
testCompiler()
{
// compiler crashes: Segfault
typedef typename A<T>::GetType<T>::blupps blupps_t;
}
int
main()
{
testCompiler<int>();
}
The compiler output of
g++-3.2 -o testCompiler testCompiler.ii
is:
testCompiler.cc: In function `void testCompiler() [with T = int]':
testCompiler.cc:22: instantiated from here
testCompiler.cc:16: internal error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
I gladly provide additional information, if that can help...
>How-To-Repeat:
Compile the preprocessed file without special flags with g++.
On my system the following is sufficient:
g++-3.2 testCompiler.ii
[g++-3.2 has to be used on my system, since g++ refers to an older version of g++]
>Fix:
None known. If you know a workaround, it would alread help alot.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="testCompiler.ii"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="testCompiler.ii"
IyAxICJ0ZXN0Q29tcGlsZXIuY2MiCiMgMSAiPGJ1aWx0LWluPiIKIyAxICI8Y29tbWFuZCBsaW5l
PiIKIyAxICJ0ZXN0Q29tcGlsZXIuY2MiCnRlbXBsYXRlIDx0eXBlbmFtZSBUPgpzdHJ1Y3QgQQp7
CiAgICB0ZW1wbGF0ZSA8dHlwZW5hbWUgVDI+CiAgICBzdHJ1Y3QgR2V0VHlwZQogICAgewogICAg
ICAgIHR5cGVkZWYgaW50IGJsdXBwczsKICAgIH07Cn07Cgp0ZW1wbGF0ZSA8dHlwZW5hbWUgVD4K
dm9pZAp0ZXN0Q29tcGlsZXIoKQp7CgogICAgdHlwZWRlZiB0eXBlbmFtZSBBPFQ+OjpHZXRUeXBl
PFQ+OjpibHVwcHMgYmx1cHBzX3Q7Cn0KCmludAptYWluKCkKewogICAgdGVzdENvbXBpbGVyPGlu
dD4oKTsKfQo=