OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-dev/] [fsf-gcc-snapshot-1-mar-12/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [warn/] [Wunused-var-12.C] - Blame information for rev 783

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/44444
2
// { dg-do compile }
3
// { dg-options "-Wunused" }
4
 
5
struct S
6
{
7
  const int &u;
8
  const int &v;
9
  S (const int &a, const int &b) : u(a), v(b) { }
10
};
11
 
12
bool
13
f1 ()
14
{
15
  bool t = false;
16
  S z = S (1, 2);
17
  t |= z.u == 1;
18
  t |= z.v == 2;
19
  return t;
20
}
21
 
22
void
23
f2 ()
24
{
25
  S z = S (1, 2);
26
  z.u;          // { dg-warning "no effect" }
27
}
28
 
29
int i;
30
 
31
void
32
f3 ()
33
{
34
  S z = S (1, 2);
35
  i++, z.u;     // { dg-warning "no effect" }
36
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.