[PATCH] D39913: [ObjC] warn about availability attributes missing from a method's declaration when they're specified for a method's definition

2017-11-25 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman requested changes to this revision. aaron.ballman added inline comments. This revision now requires changes to proceed. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:2921 +def warn_availability_on_implementation_not_interface : Warning< + "method declarati

[PATCH] D39913: [ObjC] warn about availability attributes missing from a method's declaration when they're specified for a method's definition

2017-11-25 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak accepted this revision. ahatanak added a comment. LGTM Comment at: lib/Sema/SemaDeclAttr.cpp:2295 + MissingIntroduced = + MissingIntroduced ? Decl->getIntroduced().empty() : false; + MissingDeprecated = I feel like using "if" is easi

[PATCH] D39913: [ObjC] warn about availability attributes missing from a method's declaration when they're specified for a method's definition

2017-11-17 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington accepted this revision. erik.pilkington added a comment. This revision is now accepted and ready to land. > It's harder as we don't know the distinction between declaration/definition > at merge time. Right now the C++ implementation of this warning actually > checks the attribut

[PATCH] D39913: [ObjC] warn about availability attributes missing from a method's declaration when they're specified for a method's definition

2017-11-14 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 122949. arphaman added a comment. Remove C++ support for now (it will be in a followup patch along with non-member function support). Repository: rL LLVM https://reviews.llvm.org/D39913 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clan

[PATCH] D39913: [ObjC] warn about availability attributes missing from a method's declaration when they're specified for a method's definition

2017-11-14 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. In https://reviews.llvm.org/D39913#924131, @ahatanak wrote: > Is it not necessary to print a diagnostic when a non-member function > declaration is missing an availability attribute? > > void foo1(); > > __attribute__((availability(macos, introduced=10.1))) > vo

[PATCH] D39913: [ObjC] warn about availability attributes missing from a method's declaration when they're specified for a method's definition

2017-11-13 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Is it not necessary to print a diagnostic when a non-member function declaration is missing an availability attribute? void foo1(); __attribute__((availability(macos, introduced=10.1))) void foo1() { } Repository: rL LLVM https://reviews.llvm.org/D39913

[PATCH] D39913: [ObjC] warn about availability attributes missing from a method's declaration when they're specified for a method's definition

2017-11-13 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: lib/Sema/SemaDeclAttr.cpp:2300 + }; + + llvm::SmallPtrSet MissingPlatformAttributes; erik.pilkington wrote: > I hate to rewrite your function, but have you considered just doing the > second loop over the attrs inlin

[PATCH] D39913: [ObjC] warn about availability attributes missing from a method's declaration when they're specified for a method's definition

2017-11-13 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 122740. arphaman added a comment. - formatting - simplify checks - support c++ Repository: rL LLVM https://reviews.llvm.org/D39913 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/Sema.h lib/Sema/SemaDecl.cpp lib/Sema/SemaDec

[PATCH] D39913: [ObjC] warn about availability attributes missing from a method's declaration when they're specified for a method's definition

2017-11-10 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington added a comment. Any thoughts on having this for regular functions and C++ member functions? Seems just as useful there. Comment at: include/clang/Sema/Sema.h:2406 + /// This will warn on any missing clauses in the declaration. + void checkMissingAvailability

[PATCH] D39913: [ObjC] warn about availability attributes missing from a method's declaration when they're specified for a method's definition

2017-11-10 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman created this revision. Herald added a subscriber: javed.absar. This patch extends the -Wavailability warning to warn about cases where a method declaration is missing an availability attribute clause that's present in the method's definition. We also warn about missing `deprecated` attr