This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/31923] New: g++ accepts a storage-class-specifier on a template explicit specialization
- From: "simon_baldwin at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 May 2007 19:47:39 -0000
- Subject: [Bug c++/31923] New: g++ accepts a storage-class-specifier on a template explicit specialization
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following test program compiles without error or warning on g++ (versions
2.95.3, 3.4.5, 4.0.2, 4.1.0, 4.1.1, and 4.3-20070323):
template<class T>
static void F();
template<>
static void F<int>(); // Explicit specialization with storage class specifier
The C++ standard seems to disallow this. From 7.1.1 - Storage class specifiers
[dcl.stc], para 1:
... A storage-class-specifier shall not be specified in an explicit
specialization (temp.expl.spec) or an explicit instantiation (temp.explicit)
directive.
I couldn't find an existing report of this, but may well have missed one.
--
Summary: g++ accepts a storage-class-specifier on a template
explicit specialization
Product: gcc
Version: 4.1.1
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: simon_baldwin at yahoo dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31923