]> granicus.if.org Git - clang/commitdiff
Restore warning to its original text when
authorFariborz Jahanian <fjahanian@apple.com>
Thu, 11 Jul 2013 19:13:34 +0000 (19:13 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Thu, 11 Jul 2013 19:13:34 +0000 (19:13 +0000)
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
test/SemaObjC/related-result-type-inference.m

index 1898a159306f115eb5ae1d6774780e495e8d6f26..cc0829ef67b1852127b7b3e3e6f5ff0e08e4db1b 100644 (file)
@@ -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;
 
index 6fa27b02fadaf43e11569f8ab0dfd41a7230e495..547e83fd013504c4d5d29133363109b0768d8e68 100644 (file)
@@ -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