summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/warn-unused-attribute.cpp
blob: 72f96eea0b31974302b41d295f2c573f834ab0a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// RUN: %clang_cc1 -fsyntax-only -Wunused-variable -verify %s
struct __attribute__((warn_unused)) Test
{
    Test();
    ~Test();
    void use();
};

struct TestNormal
{
    TestNormal();
};

int main()
{
   Test unused;         // expected-warning {{unused variable 'unused'}}
   Test used;
   TestNormal normal;
   used.use();
}
OpenPOWER on IntegriCloud