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

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 14 16:25:14 PST 2017


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)))
>   void foo1() {
>   }
>


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 attributes too late, after they're merged. I'll take out the C++/C support completely and keep to ObjC in this patch for simplicity. The rest can be supported later.


Repository:
  rL LLVM

https://reviews.llvm.org/D39913





More information about the cfe-commits mailing list