summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2008-08-25 18:16:36 +0000
committerAnders Carlsson <andersca@mac.com>2008-08-25 18:16:36 +0000
commit1ec2ccd8ee06f14239fdf27931aaeac8d6a3a144 (patch)
tree675605d12f0d2e1ac04df0c610b24c8607146edd /clang/test
parentdab94255474cc49516d4afba7cfa0b9815398c7b (diff)
downloadbcm5719-llvm-1ec2ccd8ee06f14239fdf27931aaeac8d6a3a144.tar.gz
bcm5719-llvm-1ec2ccd8ee06f14239fdf27931aaeac8d6a3a144.zip
Objective-C foreach selector elements must be lvalues.
llvm-svn: 55316
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaObjC/foreach-1.m10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/SemaObjC/foreach-1.m b/clang/test/SemaObjC/foreach-1.m
new file mode 100644
index 00000000000..17c0379b253
--- /dev/null
+++ b/clang/test/SemaObjC/foreach-1.m
@@ -0,0 +1,10 @@
+// RUN: clang -fsyntax-only -verify %s
+
+@class NSArray;
+
+void f(NSArray *a)
+{
+ for (int i in a); // expected-error{{selector element type ('int') is not a valid object}}
+ for ((id)2 in a); // expected-error{{selector element is not a valid lvalue}}
+ for (2 in a); // expected-error{{selector element is not a valid lvalue}}
+} \ No newline at end of file
OpenPOWER on IntegriCloud