[PATCH] D25990: Sema: do not warn about unused const vars if main file is a header

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 31 08:40:15 PDT 2016

On Thu, Oct 27, 2016 at 6:02 AM Benjamin Kramer via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> bkramer accepted this revision.
> bkramer added a comment.
> This revision is now accepted and ready to land.
> This makes sense. While variable definitions in a header are weird, the
> warning that they're unused isn't adding any value.

I'm not sure that's true - the warning will then fire for users of the
header that don't use the variable...

I'd like to know about the mistake ahead of time to avoid breaking my users.

(yes, certain headers could require their variables to be used - but that
is a slightly niche requirement that could be addressed with a ((used))

Also - does the same thing apply to static functions in headers?

- Dave

> https://reviews.llvm.org/D25990
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161031/d327f2b5/attachment.html>

More information about the cfe-commits mailing list