gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec13.C
raw| 1 | // PR c++/99501 |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | |
| 4 | template<auto> struct X; |
| 5 | |
| 6 | template<auto V> requires requires{V.a;} struct X<V>; |
| 7 | template<auto V> requires requires{V.b;} struct X<V>; |
| 8 | |
| 9 | template<auto V> requires requires{V.a;} struct X<V> { static const bool v = false; }; |
| 10 | template<auto V> requires requires{V.b;} struct X<V> { static const bool v = true; }; |
| 11 | |
| 12 | struct A { int a; }; |
| 13 | static_assert(!X<A{}>::v); |
| 14 | |
| 15 | struct B { int b; }; |
| 16 | static_assert(X<B{}>::v); |