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

            Bug ID: 90100
           Summary: [P0732] Cannot write a type-trait matching non-type
                    class template parameters
           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"

```
template<typename T>
inline constexpr bool is_nontype_list = false;

template<template<auto...> typename T, auto... NonTypes>
inline constexpr bool is_nontype_list<T<NonTypes...>> = true;

template<typename T>
concept bool NonTypeList = is_nontype_list<T>;

// works
template<auto...>
struct A {};

static_assert(is_nontype_list<A<1, 2, 3>>);

// fails
struct X {
    int v;
};

static_assert(is_nontype_list<A<X{1}, X{2}, X{3}>>);
```

See also: https://godbolt.org/z/56PLu-

Best

Mat

Reply via email to