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
PR testsuite/86649
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
inherit
/
conv3.C
blob
73d8c20f1430944c8ebffce50dce0e4b933ccd39
1
// PR 31074
2
// Bug: The reference cast wasn't finding the desired static_cast followed by
3
// const_cast interpretation.
4
5
struct Shape
6
{
7
Shape() {}
8
virtual ~Shape() {}
9
};
10
11
struct Loop
12
{
13
Loop() {}
14
virtual ~Loop() {}
15
virtual void func() {}
16
};
17
18
struct Rect :
19
public Shape,
20
public Loop
21
{
22
Rect() {}
23
virtual ~Rect() {}
24
};
25
26
int main ()
27
{
28
const Rect* rect = new Rect();
29
Loop &l = ((Loop&)(*rect));
30
return (&l != (const Loop *)rect);
31
}