]> gcc.gnu.org Git - gcc.git/blame - gcc/testsuite/g++.dg/cpp0x/range-for36.C
PR c++/92590 - wrong handling of inherited default ctor.
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / range-for36.C
CommitLineData
213f5e8a
JJ
1// PR c++/85515
2// { dg-do compile { target c++11 } }
3
4int a[10];
5
6void
7foo ()
8{
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 ();
14}
15
16template <int N>
17void
18bar ()
19{
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 ();
25}
26
27void
28baz ()
29{
30 foo ();
31 bar <0> ();
32}
This page took 1.224379 seconds and 5 git commands to generate.