[Bug c++/52231] [missed optimization/diagnostics] address-of-reference
froydnj at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Feb 18 19:44:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52231
--- Comment #5 from Nathan Froyd <froydnj at gcc dot gnu.org> ---
FWIW, clang (>= 3.5) understands how to optimize the original testcase in
comment 0; it even issues a -Wtautological-undefined-compare warning.
This also showed up in the context of trying to hint to the compiler that
placement new didn't need null checks:
#include <new>
void init(int& p) { new (&p) float(3.14f); }
which clang understands how to optimize and GCC does not.
More information about the Gcc-bugs
mailing list