2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / range-for16.C
blobbcc09cb1a0bc17bd8fe4f6835fb3c6c7a5c785e5
1 // Test for range-based for loop with arrays of
2 // incomplete type or unknown size
4 // { dg-do compile { target c++11 } }
6 extern int a[10];
7 extern int b[];
9 struct S;
10 extern S c[10];
11 extern S d[];
13 void test()
15     for (int n : a);
16     for (int n : b); // { dg-error "incomplete type" }
17     for (S &n : c); // { dg-error "incomplete type" }
18     for (S &n : d); // { dg-error "incomplete type" }
19     for (int n : *c); // { dg-error "incomplete type" }