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/const-eval.c b/test/Sema/const-eval.c
index 56c429c..bdb40ae 100644
--- a/test/Sema/const-eval.c
+++ b/test/Sema/const-eval.c
@@ -36,7 +36,7 @@
EVAL_EXPR(18, ((int)((void*)10 + 10)) == 20 ? 1 : -1);
struct s {
- int a[(int)-1.0f]; // expected-error {{array size is negative}}
+ int a[(int)-1.0f]; // expected-error {{'a' declared as an array with a negative size}}
};
EVAL_EXPR(19, ((int)&*(char*)10 == 10 ? 1 : -1));