This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52231] [missed optimization/diagnostics] address-of-reference
- From: "froydnj at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 18 Feb 2015 19:44:36 +0000
- Subject: [Bug c++/52231] [missed optimization/diagnostics] address-of-reference
- Auto-submitted: auto-generated
- References: <bug-52231-4 at http dot gcc dot gnu dot org/bugzilla/>
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.