aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec13.C
blob: b5ec2c92585b2595dbec39a7c86bbc07a82b4219 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// PR c++/99501
// { dg-do compile { target c++20 } }

template<auto> struct X;

template<auto V> requires requires{V.a;} struct X<V>;
template<auto V> requires requires{V.b;} struct X<V>;

template<auto V> requires requires{V.a;} struct X<V> { static const bool v = false; };
template<auto V> requires requires{V.b;} struct X<V> { static const bool v = true; };

struct A { int a; };
static_assert(!X<A{}>::v);

struct B { int b; };
static_assert(X<B{}>::v);