summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/warn/Wunused-parm-4.C
blob: fbad380f66c04f7743165e15de69581072556171 (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
// PR c++/47783
// { dg-do compile }
// { dg-options "-Wunused -W" }

struct R
{
  int &i;
};

void
foo (R r, int &s)
{
  r.i = 7;
  s = 8;
}

int
bar ()
{
  int x = 1, y = 1;
  R r = { x };
  foo (r, y);
  return x + y;
}