This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/41316] [C++0x] forward_list::sort violates strict aliasing rules
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Sep 2009 14:31:04 -0000
- Subject: [Bug libstdc++/41316] [C++0x] forward_list::sort violates strict aliasing rules
- References: <bug-41316-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #17 from rguenth at gcc dot gnu dot org 2009-09-09 14:31 -------
As I said the proper fix would be to move _M_sort_after to _Fwd_list_node_base
to be able to simply do
void
sort()
{
this->_M_impl._M_head._M_sort_after(std::less<_Tp>());
}
instead of going via the invalid cast.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41316