summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/warn-unused-variables.c
Commit message (Collapse)AuthorAgeFilesLines
* Keep an explicit stack of function and block scopes, each element ofDouglas Gregor2010-03-011-1/+8
| | | | | | | | | | | | | | | | | | | | which has the label map, switch statement stack, etc. Previously, we had a single set of maps in Sema (for the function) along with a stack of block scopes. However, this lead to funky behavior with nested functions, e.g., in the member functions of local classes. The explicit-stack approach is far cleaner, and we retain a 1-element cache so that we're not malloc/free'ing every time we enter a function. Fixes PR6382. Also, tweaked the unused-variable warning suppression logic to look at errors within a given Scope rather than within a given function. The prior code wasn't looking at the right number-of-errors count when dealing with blocks, since the block's count would be deallocated before we got to ActOnPopScope. This approach works with nested blocks/functions, and gives tighter error recovery. llvm-svn: 97518
* fix PR5933: don't warn about unused variables if a function has other errors ↵Chris Lattner2010-03-011-0/+6
| | | | | | in it. llvm-svn: 97498
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* Implement support for -Wunused-variable, from Oscar Bonilla!Douglas Gregor2009-10-081-0/+19
llvm-svn: 83577
OpenPOWER on IntegriCloud