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