Commit ab058972 by Richard Guenther Committed by Richard Biener

re PR tree-optimization/38937 (dereferencing pointer '<anonymous>' does break strict-aliasing)

2009-02-02  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/38937
	* g++.dg/warn/Wstrict-aliasing-bogus-escape.C: New testcase.

From-SVN: r143864
parent b5bde9ff
2009-02-02 Richard Guenther <rguenther@suse.de>
PR tree-optimization/38937
* g++.dg/warn/Wstrict-aliasing-bogus-escape.C: New testcase.
2009-02-01 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/39053
......
/* { dg-do compile } */
/* { dg-options "-O2 -Wstrict-aliasing" } */
#include <string>
#include <list>
class A;
class B {
public:
void foo(A&);
std::string s;
};
class A {
public:
A& qaz() {
l.push_back( new A() );
return *l.back();
}
std::list<A*> l;
};
void bar()
{
A a;
B b;
b.foo(a.qaz());
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment