summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-04-11 23:32:29 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-04-11 23:32:29 +0000
commit16aac6f6eb31eb5118424773411867fc3cd5fbc6 (patch)
tree433457c48571ea86386a155ad43e2c0c424aca35 /test
parentc3fa98f67038bec98651f833b685c104ef6438ab (diff)
downloadclang-16aac6f6eb31eb5118424773411867fc3cd5fbc6.tar.gz
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154564 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Sema/const-eval.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/Sema/const-eval.c b/test/Sema/const-eval.c
index a9c8806b5d..f1c0485bc1 100644
--- a/test/Sema/const-eval.c
+++ b/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}}