[Bug libstdc++/63345] Multiple undefined behaviors (static_cast<>) in libstdc++-v3/include/bits
glisse at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Sep 23 19:51:00 GMT 2014
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63345
--- Comment #3 from Marc Glisse <glisse at gcc dot gnu.org> ---
Hello,
thanks for the report. I don't think we should blindly replace static_cast with
reinterpret_cast but rather try and understand what is going on. For instance,
for std::list, I believe the only case where the cast is wrong is for the
sentinel, and we should find a way not to cast at all in that case (it might be
enough to move the cast inside the loop).
More information about the Gcc-bugs
mailing list