repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
FSF GCC merge 02/23/03
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.jason
/
rvalue2.C
blob
71f59bc68b31607089044ef790c13ef7a627a4c4
1
// Test for undesired aliasing.
2
3
struct A {
4
const A * get_this () const { return this; }
5
};
6
7
int main ()
8
{
9
A a;
10
int r = 0;
11
const A& ar1 = (A)a;
12
if (&ar1 == &a)
13
r |= 1;
14
if (A(a).get_this () == &a)
15
r |= 2;
16
return r;
17
}