diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-12-07 00:43:50 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-12-07 00:43:50 +0000 |
commit | 42d3af9d95370a9ff3844079966a34f23384ed55 (patch) | |
tree | 9a7e58bf8a75c46abf00960edce63485c4075af1 /clang/test/Sema/const-eval.c | |
parent | 6bdeb14d5d347b17c9bde8ab39c9d69b16a56a13 (diff) | |
download | bcm5719-llvm-42d3af9d95370a9ff3844079966a34f23384ed55.tar.gz bcm5719-llvm-42d3af9d95370a9ff3844079966a34f23384ed55.zip |
When folding the size of a global scope VLA to a constant, require the array
bound to not have side effects(!). Add constant-folding support for expressions
of void type, to ensure that we can still fold ((void)0, 1) as an array bound.
llvm-svn: 146000
Diffstat (limited to 'clang/test/Sema/const-eval.c')
-rw-r--r-- | clang/test/Sema/const-eval.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/Sema/const-eval.c b/clang/test/Sema/const-eval.c index 8904e12bf7a..a40039bdc5b 100644 --- a/clang/test/Sema/const-eval.c +++ b/clang/test/Sema/const-eval.c @@ -14,9 +14,9 @@ EVAL_EXPR(8, (_Bool)"asdf") EVAL_EXPR(9, !!&x) EVAL_EXPR(10, ((void)1, 12)) void g0(void); -EVAL_EXPR(11, (g0(), 12)) // FIXME: This should give an error +EVAL_EXPR(11, (g0(), 12)) // expected-error {{must have a constant size}} EVAL_EXPR(12, 1.0&&2.0) -EVAL_EXPR(13, x || 3.0) +EVAL_EXPR(13, x || 3.0) // expected-error {{must have a constant size}} unsigned int l_19 = 1; EVAL_EXPR(14, (1 ^ l_19) && 1); // expected-error {{fields must have a constant size}} |