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
Fortran: Fix PR 47485.
[gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
warn
/
Wstrict-aliasing-bogus-escape.C
blob
9d4f827c4394d4df07de8182c025331be9f911c8
1
/* { dg-do compile } */
2
/* { dg-options "-O2 -Wstrict-aliasing" } */
3
/* { dg-skip-if "requires hosted libstdc++ for string" { ! hostedlib } } */
4
5
#include <string>
6
#include <list>
7
8
class A;
9
10
class B {
11
public:
12
void foo(A&);
13
std::string s;
14
};
15
16
class A {
17
public:
18
A& qaz() {
19
l.push_back( new A() );
20
return *l.back();
21
}
22
std::list<A*> l;
23
};
24
25
void bar()
26
{
27
A a;
28
B b;
29
b.foo(a.qaz());
30
}
31