blob: bcc09cb1a0bc17bd8fe4f6835fb3c6c7a5c785e5 [file] [log] [blame]
// Test for range-based for loop with arrays of
// incomplete type or unknown size
// { dg-do compile { target c++11 } }
extern int a[10];
extern int b[];
struct S;
extern S c[10];
extern S d[];
void test()
{
for (int n : a);
for (int n : b); // { dg-error "incomplete type" }
for (S &n : c); // { dg-error "incomplete type" }
for (S &n : d); // { dg-error "incomplete type" }
for (int n : *c); // { dg-error "incomplete type" }
}