From f5200d6865fc5867ee022f876d2cdee94b48b1ee Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Thu, 11 Jul 2013 19:13:34 +0000 Subject: [PATCH] Restore warning to its original text when certain familiy of methods have the wrong type. // rdar://14408244 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186111 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaInit.cpp | 2 +- test/SemaObjC/related-result-type-inference.m | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index 1898a15930..cc0829ef67 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -4636,10 +4636,10 @@ getAssignmentAction(const InitializedEntity &Entity) { 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; diff --git a/test/SemaObjC/related-result-type-inference.m b/test/SemaObjC/related-result-type-inference.m index 6fa27b02fa..547e83fd01 100644 --- a/test/SemaObjC/related-result-type-inference.m +++ b/test/SemaObjC/related-result-type-inference.m @@ -175,7 +175,7 @@ void test_inference() { @implementation Fail - (id) 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'}} + return (id)self; // expected-warning {{casting 'Fail *' to incompatible type 'id'}} } @end @@ -197,6 +197,6 @@ void test_inference() { + (UIViewController *)newFilterViewControllerForType // expected-note {{compiler has implicitly changed method 'newFilterViewControllerForType' return type}} { UIViewController *filterVC; - return filterVC; // expected-warning {{incompatible pointer types returning 'UIViewController *' from a function with result type 'UIViewController *'}} + return filterVC; // expected-warning {{incompatible pointer types casting 'UIViewController *' to type 'UIViewController *'}} } @end -- 2.40.0