From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9772 invoked by alias); 20 Nov 2002 18:46:04 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 9753 invoked by uid 71); 20 Nov 2002 18:46:04 -0000 Resent-Date: 20 Nov 2002 18:46:04 -0000 Resent-Message-ID: <20021120184604.9752.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, martin.dorey@bluearc.com Received: (qmail 6472 invoked by uid 61); 20 Nov 2002 18:42:07 -0000 Message-Id: <20021120184207.6471.qmail@sources.redhat.com> Date: Thu, 28 Nov 2002 15:39:00 -0000 From: martin.dorey@bluearc.com Reply-To: martin.dorey@bluearc.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/8660: template overloading ICE in tsubst_expr, at cp/pt.c:7644 X-SW-Source: 2002-11/txt/msg01128.txt.bz2 List-Id: >Number: 8660 >Category: c++ >Synopsis: template overloading ICE in tsubst_expr, at cp/pt.c:7644 >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Wed Nov 20 10:46:03 PST 2002 >Closed-Date: >Last-Modified: >Originator: Martin Dorey >Release: GNU C++ version 3.2.1 20021111 (Debian prerelease) (i386-linux) >Organization: >Environment: Linux trevithick 2.4.16 #2 Mon Dec 10 15:54:50 GMT 2001 i686 unknown unknown GNU/Linux >Description: trevithick:~/stingray/test/data_structures$ gcc-3.2 -v -c -W -Wall -pedantic --save-temps bug0.cpp Reading specs from /usr/lib/gcc-lib/i386-linux/3.2.1/specs Configured with: /home/packages/gcc/3.2/gcc-3.2-3.2.1ds5/src/configure -v --enable-languages=c,c++,java,f77,proto,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 20021111 (Debian prerelease) /usr/lib/gcc-lib/i386-linux/3.2.1/cpp0 -lang-c++ -D__GNUG__=3 -D__DEPRECATED -D__EXCEPTIONS -v -D__GNUC__=3 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=1 -D__GXX_ABI_VERSION=102 -D__ELF__ -Dunix -D__gnu_linux__ -Dlinux -D__ELF__ -D__unix__ -D__gnu_linux__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -D_GNU_SOURCE -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i386__ bug0.cpp -W -Wall -pedantic bug0.ii GNU CPP version 3.2.1 20021111 (Debian prerelease) (cpplib) (i386 Linux/ELF) ignoring nonexistent directory "/usr/i386-linux/include" #include "..." search starts here: #include <...> search starts here: /usr/include/c++/3.2 /usr/include/c++/3.2/i386-linux /usr/include/c++/3.2/backward /usr/local/include /usr/lib/gcc-lib/i386-linux/3.2.1/include /usr/include End of search list. /usr/lib/gcc-lib/i386-linux/3.2.1/cc1plus -fpreprocessed bug0.ii -quiet -dumpbase bug0.cpp -W -Wall -pedantic -version -o bug0.s GNU CPP version 3.2.1 20021111 (Debian prerelease) (cpplib) (i386 Linux/ELF) GNU C++ version 3.2.1 20021111 (Debian prerelease) (i386-linux) compiled by GNU C version 3.2.1 20021111 (Debian prerelease). bug0.cpp: In member function `void BadgerBuf::ReadPod() [with B = int]': bug0.cpp:10: instantiated from here bug0.cpp:10: Internal compiler error in tsubst_expr, at cp/pt.c:7644 Please submit a full bug report, with preprocessed source if appropriate. See for instructions. >How-To-Repeat: Source is: struct BadgerBuf { void ReadPod(); template void ReadPod(); }; void BadgerBuf::ReadPod () { ReadPod (); } Adding this-> to the call to ReadPod doesn't change the behaviour. Nor does "this->template ". Putting brackets round the (ReadPod) part causes a different error: bug0.cpp: In member function `void BadgerBuf::ReadPod()': bug0.cpp:10: internal error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See for instructions. Swapping the order of the declarations avoids the problem. Unless you've left the brackets around (ReadPod) in which case it still segfaults. If you leave the declarations swapped but add another template between the class definition and the function definition, like so: struct BadgerBuf { template void ReadPod(); void ReadPod(); }; template struct Predicate {}; void BadgerBuf::ReadPod () { ReadPod (); } Then you get different behaviour again: bug0.cpp: In member function `void BadgerBuf::ReadPod()': bug0.cpp:14: parse error before `>' token Perhaps I should have submitted these as separate bugs - but I can always do that later if they turn out to be unrelated. >Fix: >Release-Note: >Audit-Trail: >Unformatted: