when compiling in a GNU mode (e.g. gnu99) treat VLAs with a size that can be folded to a constant
as constant size arrays. This has slightly different semantics in some insane cases, but allows
us to accept some constructs that GCC does. Continue to be pedantic in -std=c99 and other
modes. This addressed rdar://8733881 - error "variable-sized object may not be initialized"; g++ accepts same code
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132983 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/struct-decl.c b/test/Sema/struct-decl.c
index e1c7073..6070e87 100644
--- a/test/Sema/struct-decl.c
+++ b/test/Sema/struct-decl.c
@@ -6,7 +6,7 @@
struct foo {
char name[(int)&((struct bar *)0)->n];
- char name2[(int)&((struct bar *)0)->n - 1]; //expected-error{{array size is negative}}
+ char name2[(int)&((struct bar *)0)->n - 1]; //expected-error{{'name2' declared as an array with a negative size}}
};
// PR3430