1 // Test for range-based for loop with arrays of 2 // incomplete type or unknown size 3 4 // { dg-do compile { target c++11 } } 5 6 extern int a[10]; 7 extern int b[]; 8 9 struct S; 10 extern S c[10]; 11 extern S d[]; 12 test()13void test() 14 { 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" } 20 } 21