]> granicus.if.org Git - clang/commit
Make -Wunused warning rules more consistent.
authorEli Friedman <eli.friedman@gmail.com>
Tue, 10 Sep 2013 03:05:56 +0000 (03:05 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Tue, 10 Sep 2013 03:05:56 +0000 (03:05 +0000)
commit39bd371610af27b073c792c54c6c28133329f6ad
treebc9f1fd8779ab72e908737b84543f507898e65f0
parentb647552ab7dfdb32edf0081568db1fceec222397
Make -Wunused warning rules more consistent.

This patch does a few different things.

This patch improves unused var diags for const vars: we no longer
unconditionally suppress diagnostics for const vars, instead only suppressing
the diagnostic when the declaration appears to be useful.

This patch also makes us more consistently use whether a variable/function
is declared in the main file to suppress diagnostics where appropriate.

Fixes <rdar://problem/14907887>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190382 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/Sema.cpp
lib/Sema/SemaDecl.cpp
test/SemaCXX/Inputs/warn-unused-variables.h
test/SemaCXX/warn-unused-filescoped.cpp