Author: epilk
Date: Fri Jul  6 18:50:20 2018
New Revision: 336478

URL: http://llvm.org/viewvc/llvm-project?rev=336478&view=rev
Log:
[Sema] Emit -Wincomplete-implementation for partial methods.

Fixes rdar://40634455

Modified:
    cfe/trunk/lib/Sema/SemaDeclObjC.cpp
    cfe/trunk/test/SemaObjC/incomplete-implementation.m

Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=336478&r1=336477&r2=336478&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Fri Jul  6 18:50:20 2018
@@ -2188,17 +2188,9 @@ static void WarnUndefinedMethod(Sema &S,
                                 unsigned DiagID,
                                 NamedDecl *NeededFor = nullptr) {
   // No point warning no definition of method which is 'unavailable'.
-  switch (method->getAvailability()) {
-  case AR_Available:
-  case AR_Deprecated:
-    break;
-
-      // Don't warn about unavailable or not-yet-introduced methods.
-  case AR_NotYetIntroduced:
-  case AR_Unavailable:
+  if (method->getAvailability() == AR_Unavailable)
     return;
-  }
-  
+
   // FIXME: For now ignore 'IncompleteImpl'.
   // Previously we grouped all unimplemented methods under a single
   // warning, but some users strongly voiced that they would prefer

Modified: cfe/trunk/test/SemaObjC/incomplete-implementation.m
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/incomplete-implementation.m?rev=336478&r1=336477&r2=336478&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/incomplete-implementation.m (original)
+++ cfe/trunk/test/SemaObjC/incomplete-implementation.m Fri Jul  6 18:50:20 2018
@@ -13,6 +13,13 @@
 - Meth {return 0;} // expected-warning {{category is implementing a method 
which will also be implemented by its primary class}}
 @end
 
+// rdar://40634455
+@interface MyClass
+-(void)mymeth __attribute__((availability(macos, introduced=100))); // 
expected-note{{here}}
+@end
+@implementation MyClass // expected-warning{{'mymeth' not found}}
+@end
+
 #pragma GCC diagnostic ignored "-Wincomplete-implementation"
 @interface I2
 - Meth; // expected-note{{method 'Meth' declared here}}


_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to