aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/warn/warn_unused.C
blob: af687fc1671f2530274653cf82814cfbdd969417 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// { dg-do compile }
// { dg-options -Wunused }

struct __attribute__((warn_unused)) Test
{
    Test();
    ~Test();
    void use();
};

struct TestNormal
{
    TestNormal();
};

int main()
{
   Test unused;         // { dg-warning "unused variable" }
   Test used;           // { dg-bogus "unused variable" }
   TestNormal normal;   // { dg-bogus "unused variable" }
   used.use();
}