aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/flexible-array-test.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-03-07 20:04:04 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-03-07 20:04:04 +0000
commitd97cec3deb6e34f0f9d4f5f8ec11b28e44812727 (patch)
tree3f2d1be729838a68551fa8e3e1b75c2ee2116a83 /test/SemaCXX/flexible-array-test.cpp
parentaa11289f754d220c9c155b68a4f84cdcfcefef6a (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127171 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/flexible-array-test.cpp')
-rw-r--r--test/SemaCXX/flexible-array-test.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/SemaCXX/flexible-array-test.cpp b/test/SemaCXX/flexible-array-test.cpp
index 95d8bb1aa4..e6c3132801 100644
--- a/test/SemaCXX/flexible-array-test.cpp
+++ b/test/SemaCXX/flexible-array-test.cpp
@@ -51,5 +51,19 @@ class A {
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[];
+};
+
+}