r221562 - [Objective-C Sema]. Issue availability/deprecated warning when

Nico Weber thakis at chromium.org
Mon Dec 15 13:50:26 PST 2014


On Mon, Dec 15, 2014 at 11:43 AM, jahanian <fjahanian at apple.com> wrote:
>
>
> On Dec 12, 2014, at 3:34 PM, Nico Weber <thakis at chromium.org> wrote:
>
> Ah, I think I found it. You indented it like this:
>
>       if (Method) {
>         if (ObjCMethodDecl *BestMethod =
>               SelectBestMethod(Sel, ArgsIn, Method->isInstanceMethod()))
>           Method = BestMethod;
>           SmallVector<ObjCMethodDecl*, 4> Methods;
>           if (!CollectMultipleMethodsInGlobalPool(Sel, Methods,
> Method->isInstanceMethod()))
>             DiagnoseUseOfDecl(Method, SelLoc);
>       }
>     }
>
> but clang-format tells you that it should be indented like so:
>
>       if (Method) {
>         if (ObjCMethodDecl *BestMethod =
>                 SelectBestMethod(Sel, ArgsIn, Method->isInstanceMethod()))
>           Method = BestMethod;
>         SmallVector<ObjCMethodDecl *, 4> Methods;
>         if (!CollectMultipleMethodsInGlobalPool(Sel, Methods,
>
> Method->isInstanceMethod()))
>           DiagnoseUseOfDecl(Method, SelLoc);
>       }
>     }
>
> That is, you added the {} to the outer if, but your indentation looks like
> you mentioned to add them to the inner if. (I should dust off and check in
> my -Windent warning.)
>
>
> My intention was as I coded. Have you looked at the warning and see if it
> is indeed calling an ‘unavailable’ method which previously went
> undiagnosed? We have uncovered
> several other cases of making such calls.
>

Let's continue the discussion on http://llvm.org/bugs/show_bug.cgi?id=21587 :-)
This does look like a false positive, and it only happens with precompiled
headers (which shouldn't change behavior, but does).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141215/c74e0e22/attachment.html>


More information about the cfe-commits mailing list