commit | 268f89e02de7bddbc9d7d7a147a3003bd81cf0d7 | [log] [tgz] |
---|---|---|
author | Douglas Gregor <dgregor@apple.com> | Tue Nov 09 14:57:47 2010 +0000 |
committer | Douglas Gregor <dgregor@apple.com> | Tue Nov 09 14:57:47 2010 +0000 |
tree | e996cbbe2c2d6e030138cb9009de7ebae4eb02f2 | |
parent | 0b9c22b61a3c99c8c0e8d898adb0f60afa76584e [diff] [blame] |
Make #pragma unused work for static local variables. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118500 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/warn-unused-variables.cpp b/test/SemaCXX/warn-unused-variables.cpp index 6992cdc..8ae7d6a 100644 --- a/test/SemaCXX/warn-unused-variables.cpp +++ b/test/SemaCXX/warn-unused-variables.cpp
@@ -59,3 +59,9 @@ X<char> str (read_from_file()); // expected-error{{use of undeclared identifier 'read_from_file'}} } } + +void unused_local_static() { + static int x = 0; + static int y = 0; // expected-warning{{unused variable 'y'}} +#pragma unused(x) +}