aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/rvalue2.C
blob: 71f59bc68b31607089044ef790c13ef7a627a4c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Test for undesired aliasing.

struct A {
  const A * get_this () const { return this; }
};

int main ()
{
  A a;
  int r = 0;
  const A& ar1 = (A)a;
  if (&ar1 == &a)
    r |= 1;
  if (A(a).get_this () == &a)
    r |= 2;
  return r;
}