Debian Codegraph @

gcc/testsuite/g++.dg/cpp1z/decomp56.C

raw
1 // PR c++/84469
2 // { dg-do compile { target c++11 } }
3 // { dg-options "" }
4
5 struct A {
6 template <typename T>
7 void bar () const {}
8 template <typename T>
9 void baz () const {}
10 };
11 struct B { A a; };
12
13 template <typename>
14 void
15 foo ()
16 {
17 A a[1][1];
18 for (auto const& [b]: a) // { dg-warning "structured bindings only available with" "" { target c++14_down } }
19 b.bar<int> ();
20 B c;
21 auto const& [d] = c; // { dg-warning "structured bindings only available with" "" { target c++14_down } }
22 d.baz<double> ();
23 }
24
25 int
26 main ()
27 {
28 foo<int> ();
29 }