From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3F8DC385703A; Wed, 30 Nov 2022 14:53:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3F8DC385703A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669820031; bh=jJhx15Nuc2TBmwUP08IoV3cIZ8raR4aye44Ek0cefyI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=OUDsbEG8W8vb8lm9Lpf5EE01/PeAbqTdtvhIDjYzwBdE5tcNuzhwB5HORd6F0Gv6h PBp5tU5T1a2RxBo6I5TT8bka75MMHPEbJEgUCbVjeovCF+Th12f+dGmPHeJm++8c0B In72pChQD7Q3VkPN3xjkF3idYblPyzMDUsV2j/ZY= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/102916] cmath constexpr can lead to ODR violations/incorrect results Date: Wed, 30 Nov 2022 14:53:51 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: WONTFIX 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: resolution bug_status 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102916 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |WONTFIX Status|UNCONFIRMED |RESOLVED --- Comment #13 from Jonathan Wakely --- (In reply to Jonathan Wakely from comment #12) > This is EXTREMELY contrived. You've basically set up a program where you > detect is std::sqrt is constexpr, and then said you get different results > depending whether std::sq ... rt is constexpr. Well, yeah. Don't do that then. Nobody forces your code to check whether std::sqrt is constexpr, so just do= n't. And if your code really chooses between invoking feed_cat() and launch_missiles() based on that condition, you're screwed in C++23 anyway. So just don't do that.=