From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 00034385782A; Thu, 17 Jun 2021 21:45:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 00034385782A From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/91488] [9/10/11/12 Regression] char_traits::length causes "inlining failed in call to always_inline" error with -fgnu-tm -O2 -std=c++17 Date: Thu, 17 Jun 2021 21:45:45 +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: 10.0 X-Bugzilla-Keywords: rejects-valid, trans-mem X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 9.5 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: Thu, 17 Jun 2021 21:45:46 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D91488 --- Comment #8 from CVS Commits --- The master branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:b376b1ef38971b84975ad1540bf5d2ae0b924e76 commit r12-1603-gb376b1ef38971b84975ad1540bf5d2ae0b924e76 Author: Jonathan Wakely Date: Thu Jun 17 14:11:22 2021 +0100 libstdc++: Simplify constexpr checks in std::char_traits [PR 91488] This removes the helper functions added by r8-1294 to detect whether the char_traits member functions can be evaluated at compile time. Instead, we can just use __builtin_constant_evaluated directly, which is well supported by non-GCC compilers by now. As a result, there is a chance that those members will no longer be usable in constant expressions when using old versions of non-GCC compilers. Make the relevant feature test macros depend on the availability of __builtin_constant_evaluated, so they are defined only when the feature is actualyl available. The new testcase from the PR is added to the libitm testsuite, because that's where we can be sure it's OK to use the -fgnu-tm option. Signed-off-by: Jonathan Wakely PR libstdc++/91488 libstdc++-v3/ChangeLog: * include/bits/basic_string.h (__cpp_lib_constexpr_string): Only define when is_constant_evaluated is available. * include/bits/char_traits.h (__cpp_lib_constexpr_char_traits): Likewise. (__constant_string_p, __constant_array_p): Remove. (char_traits): Use is_constant_evaluated directly. * include/std/version (__cpp_lib_constexpr_char_traits) (__cpp_lib_constexpr_string): Only define when is_constant_evaluated is available. libitm/ChangeLog: * testsuite/libitm.c++/libstdc++-pr91488.C: New test.=