2862 – gcc accepts invalid explicit instantiation syntax (original) (raw)

Description wolfgang.bangerth 2001-05-18 01:16:01 UTC

gcc accepts the following syntax for explicit instantiations of template functions with default args:

template void f (int=0) {}; template void f<1> ();

This is most certainly not correct. Regards Wolfgang

Release: unknown

Environment: gcc 2.95, gcc cvs of May 05

How-To-Repeat: -----/gcc-bugs> cat a.cc template void f (int=0) {}; template void f<1> ();

-----/gcc-bugs> ~/Config/gcc-ss-sun/bin/gcc -W -Wall -ansi -c a.cc -o /dev/null -----/gcc-bugs> ~/Config/gcc-ss-sun/bin/gcc -v
Reading specs from /home/atlas2/wolf/Config/gcc-ss-sun/bin/../lib/gcc-lib/sparc-sun-solaris2.7/3.0/specs Configured with: ../gcc/configure --prefix=/home/people/wolf/Config/gcc-ss-sun --with-gnu-as --with-as=/usr/local/bin/as --with-gnu-ld --with-ld=/usr/local/bin/ld Thread model: posix gcc version 3.0 20010514 (prerelease)

Comment 1 Nathan Sidwell 2001-05-27 09:40:25 UTC

State-Changed-From-To: open->analyzed State-Changed-Why: confirmed

Comment 3 Kriang Lerdsuwanakij 2002-06-14 09:06:16 UTC

Responsible-Changed-From-To: unassigned->lerdsuwa Responsible-Changed-Why: Patch in progress.

Comment 4 Kriang Lerdsuwanakij 2002-07-17 07:28:20 UTC

State-Changed-From-To: analyzed->closed State-Changed-Why: Fixed in the main trunk (future GCC 3.3).