gcc/testsuite/g++.dg/cpp2a/nontype-class57.C
raw| 1 | // PR c++/110122 |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | |
| 4 | struct Foo { |
| 5 | Foo() = default; |
| 6 | Foo(const Foo&) = delete; |
| 7 | }; |
| 8 | |
| 9 | template<Foo V> |
| 10 | struct A { |
| 11 | A() { |
| 12 | [] { A a; }(); |
| 13 | [this] { this; }(); |
| 14 | } |
| 15 | |
| 16 | struct B { |
| 17 | B() { |
| 18 | [] { A a; }(); |
| 19 | [this] { this; }(); |
| 20 | } |
| 21 | }; |
| 22 | }; |
| 23 | |
| 24 | A<Foo{}> a; |
| 25 | A<Foo{}>::B b; |