This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/52231] [missed optimization/diagnostics] address-of-reference


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]