r186111 - Restore warning to its original text when
Fariborz Jahanian
fjahanian at apple.com
Thu Jul 11 12:13:34 PDT 2013
Author: fjahanian
Date: Thu Jul 11 14:13:34 2013
New Revision: 186111
URL: http://llvm.org/viewvc/llvm-project?rev=186111&view=rev
Log:
Restore warning to its original text when
certain familiy of methods have the wrong type.
// rdar://14408244
Modified:
cfe/trunk/lib/Sema/SemaInit.cpp
cfe/trunk/test/SemaObjC/related-result-type-inference.m
Modified: cfe/trunk/lib/Sema/SemaInit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaInit.cpp?rev=186111&r1=186110&r2=186111&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaInit.cpp (original)
+++ cfe/trunk/lib/Sema/SemaInit.cpp Thu Jul 11 14:13:34 2013
@@ -4636,10 +4636,10 @@ getAssignmentAction(const InitializedEnt
return Sema::AA_Passing;
case InitializedEntity::EK_Result:
- case InitializedEntity::EK_RelatedResult:
return Sema::AA_Returning;
case InitializedEntity::EK_Temporary:
+ case InitializedEntity::EK_RelatedResult:
// FIXME: Can we tell apart casting vs. converting?
return Sema::AA_Casting;
Modified: cfe/trunk/test/SemaObjC/related-result-type-inference.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/related-result-type-inference.m?rev=186111&r1=186110&r2=186111&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/related-result-type-inference.m (original)
+++ cfe/trunk/test/SemaObjC/related-result-type-inference.m Thu Jul 11 14:13:34 2013
@@ -175,7 +175,7 @@ void test_inference() {
@implementation Fail
- (id<X>) initWithX // expected-note {{compiler has implicitly changed method 'initWithX' return type}}
{
- return (id)self; // expected-warning {{returning 'Fail *' from a function with incompatible result type 'id<X>'}}
+ return (id)self; // expected-warning {{casting 'Fail *' to incompatible type 'id<X>'}}
}
@end
@@ -197,6 +197,6 @@ void test_inference() {
+ (UIViewController<PMFilterManager> *)newFilterViewControllerForType // expected-note {{compiler has implicitly changed method 'newFilterViewControllerForType' return type}}
{
UIViewController<PMFilterManager> *filterVC;
- return filterVC; // expected-warning {{incompatible pointer types returning 'UIViewController *' from a function with result type 'UIViewController<PMFilterManager> *'}}
+ return filterVC; // expected-warning {{incompatible pointer types casting 'UIViewController *' to type 'UIViewController<PMFilterManager> *'}}
}
@end
More information about the cfe-commits
mailing list