From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DC4FA3939C1E; Wed, 19 May 2021 11:13:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DC4FA3939C1E From: "joachim at joameyer dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/100676] New: Redeclaring __failed_assertion() at every point of use of __glibcxx_assert breaks Clang CUDA Date: Wed, 19 May 2021 11:13:22 +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: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: joachim at joameyer dot de 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: Wed, 19 May 2021 11:13:23 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100676 Bug ID: 100676 Summary: Redeclaring __failed_assertion() at every point of use of __glibcxx_assert breaks Clang CUDA Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: joachim at joameyer dot de Target Milestone: --- As noted in https://bugs.llvm.org/show_bug.cgi?id=3D50383 the use of __glibcxx_assert in the complex functions breaks using the complex header w= ith Clang CUDA. The way Clang CUDA handles that might not be ideal, but the libstdc++ issue seems to be present anyways: In every use of __glibcxx_assert the function __failed_assertion is redecla= red and btw. never defined, which might break other projects as well, and then = is used as an assertion in constant evaluated contexts, as it is a non constex= pr function. I wasn't able to come up with an entirely better approach so far, but I gue= ss most of the issues, that I could think of so far, would be solved by moving= the void __failed_assertion(); declaration out of the macro. This would fix the issues with Clang CUDA for example: https://cuda.godbolt.org/z/GTMnxez7j=