diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2012-04-11 23:32:29 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2012-04-11 23:32:29 +0000 |
commit | e9c64d104f3574210c095e153fa4d6c92c46486e (patch) | |
tree | db1b86a0a39c66f6a1558dc148ded17f09382baf | |
parent | c80ae58a5edc13015d124b3fa80733119c4c78b0 (diff) | |
download | bcm5719-llvm-e9c64d104f3574210c095e153fa4d6c92c46486e.tar.gz bcm5719-llvm-e9c64d104f3574210c095e153fa4d6c92c46486e.zip |
Add test for a construct we currently reject, constant-evaluating a load from a constant string. Given that gcc doesn't accept this, we should continue to not accept it, even though it was accidentally supported by clang for a brief period.
llvm-svn: 154564
-rw-r--r-- | clang/test/Sema/const-eval.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/test/Sema/const-eval.c b/clang/test/Sema/const-eval.c index a9c8806b5d9..f1c0485bc1d 100644 --- a/clang/test/Sema/const-eval.c +++ b/clang/test/Sema/const-eval.c @@ -117,3 +117,7 @@ EVAL_EXPR(42, __builtin_constant_p(pr11391.f = 1)) float varfloat; const float constfloat = 0; EVAL_EXPR(43, varfloat && constfloat) // expected-error {{must have a constant size}} + +// <rdar://problem/11205586> +// (Make sure we continue to reject this.) +EVAL_EXPR(44, "x"[0]); // expected-error {{variable length array}} |