1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
3 // Test only flexible array member functionality specific to C++.
5 union VariableSizeUnion {
10 @interface LastUnionIvar {
11 VariableSizeUnion flexible;
15 @interface NotLastUnionIvar {
16 VariableSizeUnion flexible; // expected-error {{field 'flexible' with variable sized type 'VariableSizeUnion' is not at the end of class}}
17 int last; // expected-note {{next instance variable declaration is here}}
22 class VariableSizeClass {
28 @interface LastClassIvar {
29 VariableSizeClass flexible;
33 @interface NotLastClassIvar {
34 VariableSizeClass flexible; // expected-error {{field 'flexible' with variable sized type 'VariableSizeClass' is not at the end of class}}
35 int last; // expected-note {{next instance variable declaration is here}}