1 // 68689 - flexible array members in unions accepted in C++ 2 // { dg-do compile } 3 // { dg-options "-Wno-error=pedantic" } 4 5 union U_i_ax { 6 int i; 7 int a[]; // { dg-error "flexible array member in union" } 8 }; 9 10 struct SU1 { 11 union { 12 int a[]; // { dg-error "flexible array member in union" } 13 }; 14 }; 15 16 struct SU2 { 17 int n; 18 union { 19 int a[]; // { dg-error "flexible array member in union" } 20 }; 21 }; 22 23 struct SU3 { 24 union { 25 int n; 26 int a[]; // { dg-error "flexible array member in union" } 27 }; 28 }; 29 30 union U_i_a0 { 31 int i; 32 int a[0]; 33 }; 34