gcc/testsuite/g++.dg/cpp2a/concepts-friend11a.C
raw| 1 | // CWG2596 |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | |
| 4 | struct Base {}; |
| 5 | |
| 6 | template<int N> |
| 7 | struct S : Base { |
| 8 | friend int foo(Base&) requires (N == 1); // { dg-error "must be a definition" } |
| 9 | friend int foo(Base&) requires (N == 2); // { dg-error "must be a definition" } |
| 10 | |
| 11 | template <class T> |
| 12 | friend int bar(Base&) requires (N == 1); // { dg-error "must be a definition" } |
| 13 | template <class T> |
| 14 | friend int bar(Base&) requires (N == 2); // { dg-error "must be a definition" } |
| 15 | }; |