From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10543 invoked by alias); 29 Sep 2002 10:46:02 -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 10524 invoked by uid 71); 29 Sep 2002 10:46:01 -0000 Date: Sun, 29 Sep 2002 03:46:00 -0000 Message-ID: <20020929104601.10523.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: =?iso-8859-1?Q?Pop_S=E9bastian?= Subject: Re: c++/7721: Very simple (but incorrect) template chokes g++ Reply-To: =?iso-8859-1?Q?Pop_S=E9bastian?= X-SW-Source: 2002-09/txt/msg00815.txt.bz2 List-Id: The following reply was made to PR c++/7721; it has been noted by GNATS. From: =?iso-8859-1?Q?Pop_S=E9bastian?= To: nathan@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, johnc@parore.tait.co.nz, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Cc: gdr@integrable-solutions.net Subject: Re: c++/7721: Very simple (but incorrect) template chokes g++ Date: Sun, 29 Sep 2002 12:38:38 +0200 On Fri, Sep 13, 2002 at 09:27:23PM -0000, nathan@gcc.gnu.org wrote: > Synopsis: Very simple (but incorrect) template chokes g++ > > State-Changed-From-To: open->analyzed > State-Changed-By: nathan > State-Changed-When: Fri Sep 13 14:27:23 2002 > State-Changed-Why: > confirmed as a regression > > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7721 Tested with 3 different versions of gcc: seb@myp233:~/test/cp$ gcc-2.95 -v Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.4/specs gcc version 2.95.4 20011002 (Debian prerelease) seb@myp233:~/test/cp$ gcc-3.0 -v Reading specs from /usr/lib/gcc-lib/i386-linux/3.0.4/specs Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,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-included-gettext --disable-checking --enable-threads=posix --enable-java-gc=boehm --with-cpp-install-dir=bin --enable-objc-gc i386-linux Thread model: posix gcc version 3.0.4 seb@myp233:~/test/cp$ gcc-3.2 -v Reading specs from /usr/lib/gcc-lib/i386-linux/3.2.1/specs Configured with: /mnt/data/gcc-3.1/gcc-3.2-3.2.1ds2/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-java-gc=boehm --enable-objc-gc i386-linux Thread model: posix gcc version 3.2.1 20020924 (Debian prerelease) Tested code: seb@myp233:~/test/cp$ cat pr7721.cc template class CallStrategy::CallStrategy() Results are: seb@myp233:~/test/cp$ gcc-2.95 -c pr7721.cc pr7721.cc:2: parse error before `(' seb@myp233:~/test/cp$ gcc-3.0 -c pr7721.cc pr7721.cc:4: `template class CallStrategy' as declarator (compiler error) pr7721.cc:4: syntax error at end of input seb@myp233:~/test/cp$ gcc-3.2 -c pr7721.cc pr7721.cc:4: `template struct CallStrategy' as declarator Please submit a full bug report, with preprocessed source if appropriate. See for instructions. seb@myp233:~/test/cp$ The problem is in cp/decl.c: grokdeclarator () case TEMPLATE_DECL is missing in the switch, making the function to give up on the default case label: default: => my_friendly_assert (0, 20020917); Previous version of this code was: default: - cp_compiler_error ("`%D' as declarator", decl); - return 0; /* We used to do a 155 abort here. */ + my_friendly_assert (0, 20020917); Maybe we could give a better diagnostic for this error... Gaby, can you help to fix this error? Thanks, Sebastian