aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/struct-decl.c
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-02-22 00:20:44 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-02-22 00:20:44 +0000
commit85c351551688a101c5ce918e5d60dea5177d72e7 (patch)
treea35b003eef61da0f4433af6037ce979a31edbb09 /test/Sema/struct-decl.c
parent8d7d6e9a486ad69532f9b50e75109d6ed61b0ad6 (diff)
Sanity fix for PR3642: if we're treating a diagnostic as an error, it's
required to actually be an error for correctness. The attached testcase now gives an error instead of mysteriously crashing. Now, it's possible we actually want to support the given usage, but I haven't looked at the relevant code closely. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65253 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/struct-decl.c')
-rw-r--r--test/Sema/struct-decl.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Sema/struct-decl.c b/test/Sema/struct-decl.c
index cdc9eaae3b..aa2d3b6342 100644
--- a/test/Sema/struct-decl.c
+++ b/test/Sema/struct-decl.c
@@ -22,3 +22,14 @@ int foo() {
struct st *f;
return f->v + f[0].v;
}
+
+// PR3642
+struct pppoe_tag {
+ short tag_type;
+ char tag_data[];
+};
+struct datatag {
+ struct pppoe_tag hdr; //expected-error{{variable sized type 'hdr' must be at end of struct}}
+ char data;
+};
+