summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/warn/Wunused-9.C
blob: 869888955a2e30bd1d1a5aa40a568e48d422f6ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// PR c++/11224
// { dg-options "-Wunused" }

struct someclass {

  bool isEmpty() const { return true; }
};

int main()
{
  bool bOk = false;
  someclass foo;

  bOk == foo.isEmpty(); // { dg-warning "not used" }

  return bOk;
}

int& f();

void g() {
  f() == 0; // { dg-warning "not used" }
  f() != 1; // { dg-warning "not used" }
  f() < 2; // { dg-warning "not used" }
  f() > 3; // { dg-warning "not used" }
  f() <= 4; // { dg-warning "not used" }
  f() >= 5; // { dg-warning "not used" }
  f() + 6; // { dg-warning "not used" }
  f() - 7; // { dg-warning "not used" }
  f() * 8; // { dg-warning "not used" }
  f() / 9; // { dg-warning "not used" }
  +f(); // { dg-warning "not used" }
  -f(); // { dg-warning "not used" }
  ++f();
  --f();
  f() = 10;
  f() <<= 11; 
}