repo.or.cz
/
gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Daily bump.
[gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
warn
/
Wstrict-aliasing-bogus-escape-3.C
blob
de6b2c477352a7811110abf933888df4a0c7a976
1
/* { dg-do compile } */
2
/* { dg-options "-O2 -Wstrict-aliasing" } */
3
4
struct Node_base {};
5
6
struct Node : Node_base
7
{
8
int data;
9
};
10
11
struct List
12
{
13
Node_base node, *prev;
14
15
List() : prev(&node) { xyz(); }
16
17
void xyz();
18
19
int back() { return static_cast<Node*>(prev)->data; }
20
};
21
22
struct A
23
{
24
virtual ~A();
25
};
26
27
A* foo();
28
29
void bar()
30
{
31
List y;
32
if (y.back())
33
delete foo();
34
}
35