[cfe-commits] r154564 - /cfe/trunk/test/Sema/const-eval.c

Eli Friedman eli.friedman at gmail.com
Wed Apr 11 16:32:29 PDT 2012


Author: efriedma
Date: Wed Apr 11 18:32:29 2012
New Revision: 154564

URL: http://llvm.org/viewvc/llvm-project?rev=154564&view=rev
Log:
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.


Modified:
    cfe/trunk/test/Sema/const-eval.c

Modified: cfe/trunk/test/Sema/const-eval.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/const-eval.c?rev=154564&r1=154563&r2=154564&view=diff
==============================================================================
--- cfe/trunk/test/Sema/const-eval.c (original)
+++ cfe/trunk/test/Sema/const-eval.c Wed Apr 11 18:32:29 2012
@@ -117,3 +117,7 @@
 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}}





More information about the cfe-commits mailing list