From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7A4B2386F425; Wed, 27 May 2020 08:07:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7A4B2386F425 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1590566827; bh=VTUHPrWT47HnDz08c2mCCEmucVG0m2vhnmS/runEWKw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=aLxEVLurttcQ2/FLUIKCMQzAdn8hYKeGQ4So7Fwt08Tulb0bJgwo0Ygb5R4/Ob039 LC9pKuIP6geI395DmXq/G6jrA6jQlEcq5WEigCFzdBw+OrMfyXL3OeXMGq3FouP1TG Ru3Z/ygKZ5PJmwRLLeQKhV/oN7IfbwXid8Yvopzs= From: "daniel.kruegler at googlemail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/95242] [10/11 Regression] spurious "warning: zero as null pointer constant [-Wzero-as-null-pointer-constant]" on comparisons with -std=c++2a Date: Wed, 27 May 2020 08:07:07 +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: 10.1.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: daniel.kruegler at googlemail dot com X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jason at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.2 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 May 2020 08:07:07 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95242 --- Comment #5 from Daniel Kr=C3=BCgler --- (In reply to Jonathan Wakely from comment #4) > It's consteval, the throw is there to make it not a constant expression a= nd > give an error if anything except 0 is used. i.e. it can never throw, it > either compiles or it doesn't. Sure, I understand that, but that should still result in a failure of a sta= tic assertion testing for noexcept, e.g. consider: struct __unspec=20 { consteval __unspec(int __n) { if (__n !=3D 0) throw __n; } }; static_assert(noexcept(__unspec(0))); int main() { }=