------- Comment #12 from rguenther at suse dot de  2009-09-09 11:44 -------
Subject: Re:  forward_list::sort violates strict aliasing
 rules

On Wed, 9 Sep 2009, paolo dot carlini at oracle dot com wrote:

> ------- Comment #10 from paolo dot carlini at oracle dot com  2009-09-09 
> 11:36 -------
> Ah, so, without moving _M_sort_after itself. By the way, I'm not sure to
> understand why you need an ugly reinterpret cast, aren't you just going from
> pointer to derived to pointer to base? I see the issue is tricky anyway...

I need a reinterpret_cast because a regular static_cast would be an
access as _Fwd_list_node again - at least the FE (or maybe it is 
fold after all) produces &this->D.1234 in that case which wouldn't fix
the issue.

But as can be seen in PR41317 there's some mess to sort out before the
fix can work.  Ugh.

Richard.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41316

Reply via email to