[Bug c++/90098] New: [P0732] Partial specialization of a class template with variadic parameter pack fails

mateusz.pusz at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Apr 15 13:09:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90098

            Bug ID: 90098
           Summary: [P0732] Partial specialization of a class template
                    with variadic parameter pack fails
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mateusz.pusz at gmail dot com
  Target Milestone: ---

Hi,

Compiling the code provided below with the following options produces an error:
"-std=c++2a -Wall -Wextra"

```
// works
template<typename... Ts>
struct X {};

template<typename T, typename... Rest>
struct X<T, Rest...> {};


// works
template<int... Is>
struct Y {};

template<int I, int... Rest>
struct Y<I, Rest...> {};


// error
struct A {
  int value;
  // auto operator<=>(const A&) = default;
};

template<A... Us>
struct Z {};

template<A V, A... Rest>
struct Z<V, Rest...> {};
```

Error:
<source>:25:8: error: partial specialization 'struct
Z<((A*)(void)0)->A::__ct_comp (((const A)V)), (const A)Rest ...>' is not more
specialized than [-fpermissive]
   25 | struct Z<V, Rest...> {};
      |        ^~~~~~~~~~~~~
<source>:22:8: note: primary template 'template<A ...Us> struct Z'
   22 | struct Z {};
      |        ^
<source>:25:8: error: template argument '((A*)(void)0)->A::__ct_comp (((const
A)V))' involves template parameter(s)
   25 | struct Z<V, Rest...> {};
      |        ^~~~~~~~~~~~~
<source>:25:8: error: template argument '(const A)Rest' involves template
parameter(s)

See also: https://godbolt.org/z/G96q1_.

Best

Mat


More information about the Gcc-bugs mailing list