summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/temporary7.C
blob: 9a1b78956d5e3f3217724b40f3c76af70bbb086a (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
// { dg-do run  }
// PRMS ID: 7304

struct V {
  int n;
  V() : n(0) { }
  V(int x) : n(x) { }
};

V baz(const V &x)
{
  return x;
}

int bar(V v1, V v2, V v3)
{
  return v1.n;
}

struct A {
  A(): n(7) { }
  int foo();
  V n;
};

int A::foo()
{
  V v1, v2;
  return bar(n, baz(v1), v2);
}

int main()
{
  A a;
  return (a.foo() != 7);
}