This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/2862: gcc accepts invalid explicit instantiation syntax
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/2862: gcc accepts invalid explicit instantiation syntax
- From: wolfgang dot bangerth at iwr dot uni-heidelberg dot de
- Date: 18 May 2001 08:12:21 -0000
- Reply-To: wolfgang dot bangerth at iwr dot uni-heidelberg dot de
>Number: 2862
>Category: c++
>Synopsis: gcc accepts invalid explicit instantiation syntax
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: accepts-illegal
>Submitter-Id: net
>Arrival-Date: Fri May 18 01:16:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Wolfgang Bangerth
>Release: unknown-1.0
>Organization:
>Environment:
gcc 2.95, gcc cvs of May 05
>Description:
gcc accepts the following syntax for explicit instantiations
of template functions with default args:
---------------------------------------
template <int dim> void f (int=0) {};
template void f<1> ();
---------------------------------------
This is most certainly not correct.
Regards
Wolfgang
>How-To-Repeat:
-----/gcc-bugs> cat a.cc
template <int dim> 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)
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: