gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst5.C
raw| 1 | // PR c++/96164 |
| 2 | // { dg-do compile { target concepts } } |
| 3 | |
| 4 | template <int N> |
| 5 | struct A { |
| 6 | void f() requires (N == 3) { static_assert(N == 3); } |
| 7 | }; |
| 8 | template struct A<2>; |
| 9 | |
| 10 | template <int N> |
| 11 | struct B { |
| 12 | void f() requires (N == 2) { static_assert(N == 3); } // { dg-error "assert" } |
| 13 | }; |
| 14 | template struct B<2>; |