1 // { dg-do compile { target c++17 } }
6 #pragma omp for collapse (2)
7 for (int i = 0; i < 10; ++i)
8 for (auto j : a[i]) // { dg-error "initializer expression refers to iteration variable 'i'" }
15 #pragma omp for collapse (2)
17 for (int j = i * 2; j < i * 4; j++) // { dg-error "initializer expression refers to iteration variable 'i'" }
21 struct S { int a, b, c; };
26 #pragma omp for collapse (2)
27 for (auto [i, j, k] : a) // { dg-error "initializer expression refers to iteration variable 'i'" }
28 for (int l = i; l < j; l += k) // { dg-error "condition expression refers to iteration variable 'j'" }
29 ; // { dg-error "increment expression refers to iteration variable 'k'" "" { target *-*-* } .-2 }
36 #pragma omp for collapse (2)
37 for (int i = 0; i < 10; ++i)
38 for (auto j : a[i]) // { dg-error "initializer expression refers to iteration variable 'i'" }
46 #pragma omp for collapse (2)
48 for (int j = i * 2; j < i * 4; j++) // { dg-error "initializer expression refers to iteration variable 'i'" }
56 #pragma omp for collapse (2)
57 for (auto [i, j, k] : a) // { dg-error "initializer expression refers to iteration variable 'i'" "" { target *-*-* } .-1 }
58 for (int l = i; l < j; l += k) // { dg-error "condition expression refers to iteration variable 'j'" }
59 ; // { dg-error "increment expression refers to iteration variable 'k'" "" { target *-*-* } .-3 }
66 #pragma omp for collapse (2)
67 for (T i = 0; i < 10; ++i)
68 for (auto j : a[i]) // { dg-error "initializer expression refers to iteration variable 'i'" }
76 #pragma omp for collapse (2)
78 for (T j = i * 2; j < i * 4; j++) // { dg-error "initializer expression refers to iteration variable 'i'" }
82 template <typename T, typename U>
86 #pragma omp for collapse (2)
87 for (auto [i, j, k] : a) // { dg-error "initializer expression refers to iteration variable 'i'" "" { target *-*-* } .-1 }
88 for (T l = i; l < j; l += k) // { dg-error "condition expression refers to iteration variable 'j'" }
89 ; // { dg-error "increment expression refers to iteration variable 'k'" "" { target *-*-* } .-3 }