[Bug c++/67190] New: gcc allows extra template <> on explicit template specializations
vanyacpp at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Aug 12 12:12:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67190
Bug ID: 67190
Summary: gcc allows extra template <> on explicit template
specializations
Product: gcc
Version: 5.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: vanyacpp at gmail dot com
Target Milestone: ---
GCC accepts this code:
template <typename T>
struct vector
{};
template <typename T>
struct z
{};
template <>
template <> // extra
struct z<vector<int> >
{};
After reading [temp.expl.spec] I can not find anything that forbids or allows
extra 'template<>'. MSVC rejects this code and I find this reasonable.
1>main.cpp(44): error C2910: 'z<vector<T>>' : cannot be explicitly specialized
Clang accepts this code, but it gives a warning: "extraneous template parameter
list in template specialization".
More information about the Gcc-bugs
mailing list