gcc/testsuite/g++.dg/gomp/pr105839-2.C
raw| 1 | // PR c++/105839 |
| 2 | // { dg-do compile { target c++14 } } |
| 3 | // { dg-options "-fopenmp" } |
| 4 | |
| 5 | template <typename T> |
| 6 | void |
| 7 | foo (const T &x) |
| 8 | { |
| 9 | [&] (auto &&y) |
| 10 | { |
| 11 | #pragma omp parallel for |
| 12 | for (auto &&[v1, v2] : x) // { dg-warning "structured bindings only available with" "" { target c++14_down } } |
| 13 | ; |
| 14 | } ([]{}); |
| 15 | } |
| 16 | |
| 17 | struct A { int a, b; }; |
| 18 | |
| 19 | void |
| 20 | bar () |
| 21 | { |
| 22 | A a[10]; |
| 23 | foo (a); |
| 24 | } |