PR c++/86728 - C variadic generic lambda.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / range-for36.C
blobfdf7f7b27ae6adf6a16d75406d8f53da5e033dd1
1 // PR c++/85515
2 // { dg-do compile { target c++11 } }
4 int a[10];
6 void
7 foo ()
9   for (auto &i : a)
10     if (i != *__for_begin               // { dg-error "was not declared in this scope" }
11         || &i == __for_end              // { dg-error "was not declared in this scope" }
12         || &__for_range[0] != &a[0])    // { dg-error "was not declared in this scope" }
13       __builtin_abort ();
16 template <int N>
17 void
18 bar ()
20   for (auto &i : a)
21     if (i != *__for_begin               // { dg-error "was not declared in this scope" }
22         || &i == __for_end              // { dg-error "was not declared in this scope" }
23         || &__for_range[0] != &a[0])    // { dg-error "was not declared in this scope" }
24       __builtin_abort ();
27 void
28 baz ()
30   foo ();
31   bar <0> ();