aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/flexible-array-test.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-09-03 21:53:49 +0000
committerAnders Carlsson <andersca@mac.com>2010-09-03 21:53:49 +0000
commite63438b34b075a65849b9dee022adffc7c222ae5 (patch)
treee813677ccd874e89d7b730a4bd6692515f22ea5a /test/SemaCXX/flexible-array-test.cpp
parent7925561e702430c0d632c5e5db1a74673b44ea18 (diff)
It's OK for classes to have flexible array elements (but not unions).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113018 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/flexible-array-test.cpp')
-rw-r--r--test/SemaCXX/flexible-array-test.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/SemaCXX/flexible-array-test.cpp b/test/SemaCXX/flexible-array-test.cpp
index 02e3f83974..95d8bb1aa4 100644
--- a/test/SemaCXX/flexible-array-test.cpp
+++ b/test/SemaCXX/flexible-array-test.cpp
@@ -43,3 +43,13 @@ struct X {
int blah;
S strings[]; // expected-error {{flexible array member 'strings' of non-POD element type 'S []'}}
};
+
+class A {
+ int s;
+ char c[];
+};
+
+union B {
+ int s;
+ char c[]; // expected-error {{field has incomplete type 'char []'}}
+};