OSDN Git Service
(root)
/
pf3gnuchains
/
gcc-fork.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
cp/:
[pf3gnuchains/gcc-fork.git]
/
gcc
/
testsuite
/
g++.dg
/
warn
/
Wstrict-aliasing-bogus-escape.C
1
/* { dg-do compile } */
2
/* { dg-options "-O2 -Wstrict-aliasing" } */
3
4
#include <string>
5
#include <list>
6
7
class A;
8
9
class B {
10
public:
11
void foo(A&);
12
std::string s;
13
};
14
15
class A {
16
public:
17
A& qaz() {
18
l.push_back( new A() );
19
return *l.back();
20
}
21
std::list<A*> l;
22
};
23
24
void bar()
25
{
26
A a;
27
B b;
28
b.foo(a.qaz());
29
}
30