diff options
author | Chris Lattner <sabre@nondot.org> | 2010-03-01 21:06:03 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-03-01 21:06:03 +0000 |
commit | efc83e60d349da075491f03373ffed92065afb0a (patch) | |
tree | 4d71d46a3376d40f0f2d023e86e6bbc7cee18a80 /clang/test/Sema/warn-unused-variables.c | |
parent | 30d0cfda354ec7f271ff3fa006db02d10a9e9610 (diff) | |
download | bcm5719-llvm-efc83e60d349da075491f03373ffed92065afb0a.tar.gz bcm5719-llvm-efc83e60d349da075491f03373ffed92065afb0a.zip |
fix PR5933: don't warn about unused variables if a function has other errors in it.
llvm-svn: 97498
Diffstat (limited to 'clang/test/Sema/warn-unused-variables.c')
-rw-r--r-- | clang/test/Sema/warn-unused-variables.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/Sema/warn-unused-variables.c b/clang/test/Sema/warn-unused-variables.c index 36615061fe6..4d1cde7067e 100644 --- a/clang/test/Sema/warn-unused-variables.c +++ b/clang/test/Sema/warn-unused-variables.c @@ -17,3 +17,9 @@ void f1(void) { (void)sizeof(i); return; } + +// PR5933 +int f2() { + int X = 4; // Shouldn't have a bogus 'unused variable X' warning. + return Y + X; // expected-error {{use of undeclared identifier 'Y'}} +} |