[Bug c++/32056] New: Storage classes on template parameters
andrew dot stubbs at st dot com
gcc-bugzilla@gcc.gnu.org
Wed May 23 12:04:00 GMT 2007
None of the following should be accepted.
template <auto int T> struct A {};
template <extern int T> struct B {};
template <static int T> struct C {};
template <register int T> struct D {};
template <mutable int T> struct E {};
The extern, static and mutable are rejected with this message:
t.cxx:2: error: storage class specifiers invalid in parameter declarations
t.cxx:2: error: storage class specified for parameter ÂTÂ
t.cxx:3: error: storage class specifiers invalid in parameter declarations
t.cxx:3: error: storage class specified for parameter ÂTÂ
t.cxx:5: error: non-member ÂTÂ cannot be declared ÂmutableÂ
But static and register have been accepted.
Clause 14.1/2 of the C++ standard says that storage classes should not be used
here.
--
Summary: Storage classes on template parameters
Product: gcc
Version: 4.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: andrew dot stubbs at st dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32056
More information about the Gcc-bugs
mailing list