[cfe-commits] r158998 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td test/Parser/objc-forcollection-neg.m test/SemaObjCXX/instantiate-stmt.mm
Fariborz Jahanian
fjahanian at apple.com
Fri Jun 22 08:37:00 PDT 2012
Author: fjahanian
Date: Fri Jun 22 10:37:00 2012
New Revision: 158998
URL: http://llvm.org/viewvc/llvm-project?rev=158998&view=rev
Log:
objective-c: improve diagnostic when collection expression is
not a pointer to a fast-enumerable object. // rdar://11488666
Modified:
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/test/Parser/objc-forcollection-neg.m
cfe/trunk/test/SemaObjCXX/instantiate-stmt.mm
Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=158998&r1=158997&r2=158998&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Fri Jun 22 10:37:00 2012
@@ -5485,7 +5485,7 @@
def err_selector_element_type : Error<
"selector element type %0 is not a valid object">;
def err_collection_expr_type : Error<
- "collection expression type %0 is not a valid object">;
+ "the type %0 is not a pointer to a fast-enumerable object">;
def warn_collection_expr_type : Warning<
"collection expression type %0 may not respond to %1">;
Modified: cfe/trunk/test/Parser/objc-forcollection-neg.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/objc-forcollection-neg.m?rev=158998&r1=158997&r2=158998&view=diff
==============================================================================
--- cfe/trunk/test/Parser/objc-forcollection-neg.m (original)
+++ cfe/trunk/test/Parser/objc-forcollection-neg.m Fri Jun 22 10:37:00 2012
@@ -26,12 +26,12 @@
int i=0;
for (int * elem in elem) // expected-error {{selector element type 'int *' is not a valid object}} \
- expected-error {{collection expression type 'int *' is not a valid object}}
+ expected-error {{the type 'int *' is not a pointer to a fast-enumerable object}}
++i;
for (i in elem) // expected-error {{use of undeclared identifier 'elem'}} \
expected-error {{selector element type 'int' is not a valid object}}
++i;
- for (id se in i) // expected-error {{collection expression type 'int' is not a valid object}}
+ for (id se in i) // expected-error {{the type 'int' is not a pointer to a fast-enumerable object}}
++i;
}
@end
Modified: cfe/trunk/test/SemaObjCXX/instantiate-stmt.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjCXX/instantiate-stmt.mm?rev=158998&r1=158997&r2=158998&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjCXX/instantiate-stmt.mm (original)
+++ cfe/trunk/test/SemaObjCXX/instantiate-stmt.mm Fri Jun 22 10:37:00 2012
@@ -38,20 +38,20 @@
template<typename E, typename T>
void fast_enumeration_test(T collection) {
for (E element in collection) { // expected-error{{selector element type 'int' is not a valid object}} \
- // expected-error{{collection expression type 'vector' is not a valid object}}
+ // expected-error{{the type 'vector' is not a pointer to a fast-enumerable object}}
eat(element);
}
E element;
for (element in collection) // expected-error{{selector element type 'int' is not a valid object}} \
- // expected-error{{collection expression type 'vector' is not a valid object}}
+ // expected-error{{the type 'vector' is not a pointer to a fast-enumerable object}}
eat(element);
- for (NSString *str in collection) // expected-error{{collection expression type 'vector' is not a valid object}}
+ for (NSString *str in collection) // expected-error{{the type 'vector' is not a pointer to a fast-enumerable object}}
eat(str);
NSString *str;
- for (str in collection) // expected-error{{collection expression type 'vector' is not a valid object}}
+ for (str in collection) // expected-error{{the type 'vector' is not a pointer to a fast-enumerable object}}
eat(str);
}
More information about the cfe-commits
mailing list