Debian Codegraph @

gcc/testsuite/g++.dg/cpp2a/nontype-class59.C

raw
1 // PR c++/110122
2 // { dg-do compile { target c++20 } }
3
4 struct Foo {
5 Foo() = default;
6 constexpr Foo(const Foo&) { }
7 };
8
9 struct Bar {
10 Foo _;
11 };
12
13 template<Bar V>
14 struct A { };
15
16 template<Bar V>
17 void f() {
18 [](auto){ A<V> d; }(0); // { dg-bogus "used before its definition" }
19 };
20
21 int main() {
22 f<Bar{}>();
23 }