Daniel Dunbar | 8fbe78f | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -Wunused-variable -verify %s |
Douglas Gregor | 3beaf9b | 2009-10-08 21:35:42 +0000 | [diff] [blame] | 2 | |
| 3 | struct s0 { |
| 4 | unsigned int i; |
| 5 | }; |
| 6 | |
| 7 | int proto(int a, int b); |
| 8 | |
| 9 | void f0(void) { |
| 10 | int a __attribute__((unused)), |
| 11 | b; // expected-warning{{unused}} |
| 12 | return; |
| 13 | } |
| 14 | |
| 15 | void f1(void) { |
| 16 | int i; |
| 17 | (void)sizeof(i); |
| 18 | return; |
| 19 | } |
Chris Lattner | efc83e6 | 2010-03-01 21:06:03 +0000 | [diff] [blame] | 20 | |
| 21 | // PR5933 |
| 22 | int f2() { |
| 23 | int X = 4; // Shouldn't have a bogus 'unused variable X' warning. |
| 24 | return Y + X; // expected-error {{use of undeclared identifier 'Y'}} |
| 25 | } |