diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-03-07 20:04:04 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-03-07 20:04:04 +0000 |
commit | 7e25a95600fe31c47125bca36d0553915658d8af (patch) | |
tree | bc1703066babcb0be7ed59e796a8b3487ba1495a /clang/test/SemaCXX/flexible-array-test.cpp | |
parent | e5d7369e1eee20ae59b5a07bc28f2a8de8d420b5 (diff) | |
download | bcm5719-llvm-7e25a95600fe31c47125bca36d0553915658d8af.tar.gz bcm5719-llvm-7e25a95600fe31c47125bca36d0553915658d8af.zip |
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
Diffstat (limited to 'clang/test/SemaCXX/flexible-array-test.cpp')
-rw-r--r-- | clang/test/SemaCXX/flexible-array-test.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/clang/test/SemaCXX/flexible-array-test.cpp b/clang/test/SemaCXX/flexible-array-test.cpp index 95d8bb1aa41..e6c3132801f 100644 --- a/clang/test/SemaCXX/flexible-array-test.cpp +++ b/clang/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[]; +}; + +} |