aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/const-eval.c
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-06-14 06:38:10 +0000
committerChris Lattner <sabre@nondot.org>2011-06-14 06:38:10 +0000
commite1eed38733ed47d44f9d8c7731817c411eaf4141 (patch)
tree892eac9a394c9c6c0f3f8f4df555b7a855cab903 /test/Sema/const-eval.c
parent24c38e1ff057ce49c866294bf486444255e18f31 (diff)
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
Diffstat (limited to 'test/Sema/const-eval.c')
-rw-r--r--test/Sema/const-eval.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/Sema/const-eval.c b/test/Sema/const-eval.c
index 56c429c58c..bdb40ae54b 100644
--- a/test/Sema/const-eval.c
+++ b/test/Sema/const-eval.c
@@ -36,7 +36,7 @@ int g17[(3?:1) - 2];
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));