summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaObjCXX/foreach.mm
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaObjCXX/foreach.mm')
-rw-r--r--clang/test/SemaObjCXX/foreach.mm8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/SemaObjCXX/foreach.mm b/clang/test/SemaObjCXX/foreach.mm
index 99f5d0ce55e..e39815d3e9c 100644
--- a/clang/test/SemaObjCXX/foreach.mm
+++ b/clang/test/SemaObjCXX/foreach.mm
@@ -14,6 +14,14 @@ void f(NSArray *a) {
for (auto thisKey : keys) { } // expected-warning{{'auto' deduced as 'id' in declaration of 'thisKey'}}
}
+void for_init_stmt() {
+ for (id keys; id key : keys) {} // expected-warning{{extension}} expected-error{{not supported}}
+}
+template<typename T> void for_init_stmt_tmpl() {
+ for (T keys; id key : keys) {} // expected-warning{{extension}} expected-error{{not supported}}
+}
+template void for_init_stmt_tmpl<id>(); // expected-note {{in instantiation of}}
+
template<typename Collection>
void ft(Collection col) {
for (id x : col) { }
OpenPOWER on IntegriCloud