This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/67190] New: gcc allows extra template <> on explicit template specializations
- From: "vanyacpp at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 12 Aug 2015 12:11:59 +0000
- Subject: [Bug c++/67190] New: gcc allows extra template <> on explicit template specializations
- Auto-submitted: auto-generated
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".