This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/58031] New: invalid class template partial specialization accepted where argument list identical to primary template
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 30 Jul 2013 16:27:19 +0000
- Subject: [Bug c++/58031] New: invalid class template partial specialization accepted where argument list identical to primary template
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58031
Bug ID: 58031
Summary: invalid class template partial specialization accepted
where argument list identical to primary template
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Keywords: accepts-invalid
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: redi at gcc dot gnu.org
template<template<typename...> class T>
struct X
{ };
template<template<typename> class T>
struct X<T>
{ };
template<typename T> struct Y { };
X<Y> x;
The partial specialization is ill-formed, 14.5.5 [temp.class.spec] p8 says
Within the argument list of a class template partial specialization,
the following restrictions apply:
- [...]
- [...]
- The argument list of the specialization shall not be identical
to the implicit argument list of the primary template.
The implicit argument list of the primary template is T, which is identical to
that of the partial specialization.
Clang and MSVC reject it.