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
llvm-svn: 132983
diff --git a/clang/test/Sema/const-eval.c b/clang/test/Sema/const-eval.c
index 56c429c..bdb40ae 100644
--- a/clang/test/Sema/const-eval.c
+++ b/clang/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));