aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/nontype-class22.C
blob: 026855f0bc65e08850b538f94da47faca7e1eec7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// PR c++/90100
// { dg-do compile { target c++2a } }

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;

// 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}>>);