OSDN Git Service

2008-08-13 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / warn / Wunused-9.C
1 // PR c++/11224
2 // { dg-options "-Wunused" }
3
4 struct someclass {
5
6   bool isEmpty() const { return true; }
7 };
8
9 int main()
10 {
11   bool bOk = false;
12   someclass foo;
13
14   bOk == foo.isEmpty(); // { dg-warning "not used" }
15
16   return bOk;
17 }
18
19 int& f();
20
21 void g() {
22   f() == 0; // { dg-warning "not used" }
23   f() != 1; // { dg-warning "not used" }
24   f() < 2; // { dg-warning "not used" }
25   f() > 3; // { dg-warning "not used" }
26   f() <= 4; // { dg-warning "not used" }
27   f() >= 5; // { dg-warning "not used" }
28   f() + 6; // { dg-warning "not used" }
29   f() - 7; // { dg-warning "not used" }
30   f() * 8; // { dg-warning "not used" }
31   f() / 9; // { dg-warning "not used" }
32   +f(); // { dg-warning "not used" }
33   -f(); // { dg-warning "not used" }
34   ++f();
35   --f();
36   f() = 10;
37   f() <<= 11; 
38 }