From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 75BEF385DC05; Sat, 11 Apr 2020 21:27:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 75BEF385DC05 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1586640451; bh=vyWi9hSha6siccdSTCMZ0d9qV19sZM/Z2+DYFciLtI0=; h=From:To:Subject:Date:From; b=pQ9sZAbBeXoZu3prFzEHJJy4YkBbMfaRbR/eHiWyL/qsZmgqued2bOe3PrIB43VU4 4159bDYharJSccd/r6aEVwTBHWT8I+5f4VpvAw+cnJzbA0HVLlmkrUWk1OeiGo0LZQ /rPaloiossHWsaz5l48jmJMhVwNj0fj3UOAahy64= From: "daniel.kruegler at googlemail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/94565] New: C++20: Comparing comparison category types against 0/nullptr is not noexcept Date: Sat, 11 Apr 2020 21:27:31 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: daniel.kruegler at googlemail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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: Sat, 11 Apr 2020 21:27:31 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94565 Bug ID: 94565 Summary: C++20: Comparing comparison category types against 0/nullptr is not noexcept Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: daniel.kruegler at googlemail dot com Target Milestone: --- The following program should be accepted, but is rejected due to a violatio= n of the static_assertion: Compiler options: -Wall -Wextra -pedantic "-std=3Dc++20" //--------------------- #include int main() { static_assert(noexcept(std::partial_ordering::less =3D=3D 0)); } //--------------------- prog.cc: In function 'int main()': prog.cc:5:17: error: static assertion failed 5 | static_assert(noexcept(std::partial_ordering::less =3D=3D 0)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The corresponding comparison functions for are all declared as noexcept ([cmp.partialord], [cmp.weakord], [cmp.strongord]), so the clear intention = is that such an comparison should be observable as non-throwing operations. The reason why above test fails for all of the existing mixed comparison functi= ons of all the three comparison category types against 0/nullptr is caused by t= he fact that the implementation-internal type std::__cmp_cat::__unspec in head= er misses to declare its converting constructor as noexcept: struct __unspec { constexpr __unspec(__unspec*) { } };=