This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/58031] New: invalid class template partial specialization accepted where argument list identical to primary template


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]