repo.or.cz
/
gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Fortran: Fix PR 47485.
[gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
warn
/
Wunused-var-12.C
blob
3300cbe3d8ad5a70e020423c8974aaa8086db4e1
1
// 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
}