Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / SemaCXX / warn-unused-attribute.cpp
blobdffda31f464627a9eead8346099901d482a43f9d
1 // RUN: %clang_cc1 -fsyntax-only -Wunused-variable -verify %s
2 struct __attribute__((warn_unused)) Test {
3 Test();
4 ~Test();
5 void use();
6 };
8 struct TestNormal {
9 TestNormal();
12 int main(void) {
13 Test unused; // expected-warning {{unused variable 'unused'}}
14 Test used;
15 TestNormal normal;
16 used.use();
18 int i __attribute__((warn_unused)) = 12; // expected-warning {{'warn_unused' attribute only applies to structs, unions, and classes}}
19 return i;