| 1 |
// PR c++/101247 |
| 2 |
// { dg-do compile { target concepts } } |
| 3 |
// A variant of concepts-memtmpl3.C where f is defined outside A's definition. |
| 4 |
|
| 5 |
template <typename> struct A { |
| 6 |
template <typename c> static constexpr bool d = true; |
| 7 |
struct B; |
| 8 |
template <typename> struct C; |
| 9 |
}; |
| 10 |
|
| 11 |
template <typename a> |
| 12 |
struct A<a>::B { |
| 13 |
template <typename c> static void f(c) requires d<c>; |
| 14 |
}; |
| 15 |
|
| 16 |
template <typename a> |
| 17 |
template <typename b> |
| 18 |
struct A<a>::C { |
| 19 |
template <typename c> static void f(c) requires d<c>; |
| 20 |
static void g() requires d<b>; |
| 21 |
}; |
| 22 |
|
| 23 |
int main() |
| 24 |
{ |
| 25 |
A<void>::B::f(0); |
| 26 |
A<void>::C<int>::f(0); |
| 27 |
A<void>::C<int>::g(); |
| 28 |
} |