aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/clang/Basic/DiagnosticSemaKinds.def2
-rw-r--r--test/Sema/struct-decl.c11
2 files changed, 12 insertions, 1 deletions
diff --git a/include/clang/Basic/DiagnosticSemaKinds.def b/include/clang/Basic/DiagnosticSemaKinds.def
index 7ebb5a706c..fb9f36399b 100644
--- a/include/clang/Basic/DiagnosticSemaKinds.def
+++ b/include/clang/Basic/DiagnosticSemaKinds.def
@@ -728,7 +728,7 @@ DIAG(err_field_declared_as_function, ERROR,
"field %0 declared as a function")
DIAG(err_field_incomplete, ERROR,
"field has incomplete type %0")
-DIAG(err_variable_sized_type_in_struct, EXTENSION,
+DIAG(err_variable_sized_type_in_struct, ERROR,
"variable sized type %0 must be at end of struct or class")
DIAG(err_flexible_array_empty_struct, ERROR,
"flexible array %0 not allowed in otherwise empty struct")
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;
+};
+