mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-25 06:18:56 -04:00

meaningful to odr-use the VarDecl inside a variable template. (Separately, it'd be nice to track referenced-ness for templates, and warn on unused ones, but that's really a distinct issue...) Move a test that generates and tests a warning-suppressing error out to its own test file, so it doesn't have weird effects on the other tests in the same file. llvm-svn: 205448
27 lines
821 B
C++
27 lines
821 B
C++
// RUN: %clang_cc1 -fsyntax-only -Wunused-variable -Wunused-label -verify %s
|
|
|
|
static int unused_local_static;
|
|
|
|
namespace PR8455 {
|
|
void f() {
|
|
A: // expected-warning {{unused label 'A'}}
|
|
__attribute__((unused)) int i; // attribute applies to variable
|
|
B: // attribute applies to label
|
|
__attribute__((unused)); int j; // expected-warning {{unused variable 'j'}}
|
|
}
|
|
|
|
void g() {
|
|
C: // unused label 'C' will not appear here because an error has occurred
|
|
__attribute__((unused))
|
|
#pragma weak unused_local_static // expected-error {{expected ';' after __attribute__}}
|
|
;
|
|
}
|
|
|
|
void h() {
|
|
D: // expected-warning {{unused label 'D'}}
|
|
#pragma weak unused_local_static
|
|
__attribute__((unused)) // expected-warning {{declaration does not declare anything}}
|
|
;
|
|
}
|
|
}
|