From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1748 invoked by alias); 18 Feb 2015 21:40:49 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 1705 invoked by uid 48); 18 Feb 2015 21:40:44 -0000 From: "froydnj at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/52231] [missed optimization/diagnostics] address-of-reference Date: Wed, 18 Feb 2015 22:04:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.6.3 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: froydnj at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-02/txt/msg02070.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52231 --- Comment #7 from Nathan Froyd --- (In reply to Jonathan Wakely from comment #6) > (In reply to Nathan Froyd from comment #5) > > This also showed up in the context of trying to hint to the compiler that > > placement new didn't need null checks: > > That's only become true quite recently: > http://open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1748 Ah, thanks for the pointer. I assumed that the compiler would be able to infer that |&reference| would be non-null and eliminate the mandatory check regardless, but it's nice to have spec language to back this up. > See also PR 35878 Again, thanks for the pointer. If we can do this in the frontend now, that might be simple enough that I could take a look at it myself (assuming it hasn't been done and that PR simply didn't get referenced).