From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 460013858D38; Fri, 4 Nov 2022 04:17:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 460013858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667535456; bh=x8sdvjVcETb10eDQogA06aPIGYcbxGGbBfQJaRdjDGI=; h=From:To:Subject:Date:From; b=gWgn9NOCCaN6GIIz9R9JwVYpd1K++93rLfhsq0eF/ZRZv6v4sgV2jX5Y8Ogfb5k07 5ExR6NtNadMW9f8o1T6qCZVjB06oia1so3Tck2s7q2BERpILeRY1v1ZE6ffPwblrx6 oBMWv+aWskrkerwccNkTJOoj5zlipob+WKvVSmtE= From: "tim at klingt dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107521] New: clang rejects invalid code in libstdc++ Date: Fri, 04 Nov 2022 04:17:34 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tim at klingt dot org 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107521 Bug ID: 107521 Summary: clang rejects invalid code in libstdc++ Product: gcc Version: 12.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: tim at klingt dot org Target Milestone: --- compare https://github.com/llvm/llvm-project/issues/58754 https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/include/bits= /char_traits.h#L216-L217 ``` if (__s1 =3D=3D __s2) // unlikely, but saves a lot of work return __s1; ``` according to aaron ballman: > Heh, that's a fun one. http://eel.is/c++draft/lex.string#9 is what that c= ode is referring to and I believe Clang is correct to reject it as a core c= onstant expression per http://eel.is/c++draft/expr.const#5.24 because the e= quality operator's results are unspecified. according to jonathan wakely: > This is a libstdc++ bug. > And a g++ bug, for letting me do it.=