summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/p11144.C
blob: cd1483eba4ca5d201d51e2ce176d3a48c7e00996 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// { dg-do run  }
// { dg-options "-O" }
// prms-id: 11144

class Id {
public:
  int d_i;
  Id(int i) : d_i(i) {}
  int value() {return d_i;}
} ID(1);

Id foo() { return ID; }

int main() {
  const Id &id1 = foo();
  const Id &id2 = foo();
  return &id1 == &id2;
}