diff options
author | Erik Pilkington <erik.pilkington@gmail.com> | 2018-07-07 01:50:20 +0000 |
---|---|---|
committer | Erik Pilkington <erik.pilkington@gmail.com> | 2018-07-07 01:50:20 +0000 |
commit | ecce5c95977ff018ab6e5200bb2937c6b10a7ef0 (patch) | |
tree | 129476e8aa83556d0336b175547c1d1af1df6977 | |
parent | d8b0c8ce1b30035221a8623fea5b4a0735fcac5c (diff) | |
download | bcm5719-llvm-ecce5c95977ff018ab6e5200bb2937c6b10a7ef0.tar.gz bcm5719-llvm-ecce5c95977ff018ab6e5200bb2937c6b10a7ef0.zip |
[Sema] Emit -Wincomplete-implementation for partial methods.
Fixes rdar://40634455
llvm-svn: 336478
-rw-r--r-- | clang/lib/Sema/SemaDeclObjC.cpp | 12 | ||||
-rw-r--r-- | clang/test/SemaObjC/incomplete-implementation.m | 7 |
2 files changed, 9 insertions, 10 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index 6809b48dc8a..8c621dfa40c 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/lib/Sema/SemaDeclObjC.cpp @@ -2188,17 +2188,9 @@ static void WarnUndefinedMethod(Sema &S, SourceLocation ImpLoc, 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 diff --git a/clang/test/SemaObjC/incomplete-implementation.m b/clang/test/SemaObjC/incomplete-implementation.m index 74dea2aa86b..910cda5f07d 100644 --- a/clang/test/SemaObjC/incomplete-implementation.m +++ b/clang/test/SemaObjC/incomplete-implementation.m @@ -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}} |