summaryrefslogtreecommitdiffstats
path: root/clang/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
commitf35de48c905803359f1a5454d6024806db8ca989 (patch)
treeb60912ce4a2f88448f1c27859ea3757c97e84d4f /clang/test/Sema/const-eval.c
parentb5f19d9f6f842473627561a03ca76aa4be765ccc (diff)
downloadbcm5719-llvm-f35de48c905803359f1a5454d6024806db8ca989.tar.gz
bcm5719-llvm-f35de48c905803359f1a5454d6024806db8ca989.zip
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
Diffstat (limited to 'clang/test/Sema/const-eval.c')
-rw-r--r--clang/test/Sema/const-eval.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/Sema/const-eval.c b/clang/test/Sema/const-eval.c
index 56c429c58c2..bdb40ae54be 100644
--- a/clang/test/Sema/const-eval.c
+++ b/clang/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));
OpenPOWER on IntegriCloud