g++ is more permissive regarding flexible arrays.
It will accept flexible array in union and also as the sole element of a struct/class.
Fixes rdar://9065507.
llvm-svn: 127171
diff --git a/clang/test/SemaCXX/flexible-array-test.cpp b/clang/test/SemaCXX/flexible-array-test.cpp
index 95d8bb1..e6c3132 100644
--- a/clang/test/SemaCXX/flexible-array-test.cpp
+++ b/clang/test/SemaCXX/flexible-array-test.cpp
@@ -51,5 +51,19 @@
union B {
int s;
- char c[]; // expected-error {{field has incomplete type 'char []'}}
+ char c[];
};
+
+namespace rdar9065507 {
+
+struct StorageBase {
+ long ref_count;
+ unsigned size;
+ unsigned capacity;
+};
+
+struct Storage : StorageBase {
+ int data[];
+};
+
+}