On Thu, Oct 27, 2016 at 6:02 AM Benjamin Kramer via cfe-commits <
cfe-commits@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
erikjv closed this revision.
erikjv added a comment.
Committed as r285386.
https://reviews.llvm.org/D25990
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
bkramer added inline comments.
Comment at: lib/Sema/Sema.cpp:870
+ if (SM.getMainFileID() != SM.getFileID(DiagD->getLocation())
+ || !PP.getLangOpts().IsHeaderFile)
+Diag(DiagD->getLocation(), diag::warn_unused_const_variable)
Do
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.
https://reviews.llvm.org/D25990
__
erikjv created this revision.
erikjv added a reviewer: bkramer.
erikjv added a subscriber: cfe-commits.
If we pass a header to libclang, e.g. because it's open in an editor in
an IDE, warnings about unused const vars are not useful: other files
that include the header might use those constants. So