From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 7BB673858D20; Sat, 6 Jan 2024 13:40:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7BB673858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1704548406; bh=unRi6g53K50yXEh8Ep4LnmyRa+81/9YR4C1nQsIugbc=; h=From:To:Subject:Date:From; b=cpkUlngQBntOMddQMpWOAxLmyTvMInmOc/voM6AzQLq9Q7X165TxZNTfo8y9oc7mL Wu7z0EOIQMxBCBA8kMtd9Y2Ar8lRuweHe7BgcIQOdeLCyRBWmGYlNgEeL4O/yiU9Dl vV1DEL47wqZrekuEzRlWILWs2W9xnl9p4t0703Rg= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r13-8194] libstdc++: Do not use __is_convertible unconditionally [PR113241] X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/releases/gcc-13 X-Git-Oldrev: 22601c1c25652c71c8bab4707866c020d6dad79a X-Git-Newrev: 4c66513656775d551db36b53c253cf236f0eeba8 Message-Id: <20240106134006.7BB673858D20@sourceware.org> Date: Sat, 6 Jan 2024 13:40:06 +0000 (GMT) List-Id: https://gcc.gnu.org/g:4c66513656775d551db36b53c253cf236f0eeba8 commit r13-8194-g4c66513656775d551db36b53c253cf236f0eeba8 Author: Jonathan Wakely Date: Fri Jan 5 12:03:22 2024 +0000 libstdc++: Do not use __is_convertible unconditionally [PR113241] The new __is_convertible built-in should only be used after checking that it's supported. libstdc++-v3/ChangeLog: PR libstdc++/113241 * include/std/type_traits (is_convertible_v): Guard use of built-in with preprocessor check. (cherry picked from commit 57fa5b60bbbf8038b8a699d2bcebd2a9b2e29aa4) Diff: --- libstdc++-v3/include/std/type_traits | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 2bd607a8b8f..2b05e371953 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -3359,8 +3359,13 @@ template #endif template inline constexpr bool is_base_of_v = __is_base_of(_Base, _Derived); +#if __has_builtin(__is_convertible) template inline constexpr bool is_convertible_v = __is_convertible(_From, _To); +#else +template + inline constexpr bool is_convertible_v = is_convertible<_From, _To>::value; +#endif template inline constexpr bool is_invocable_v = is_invocable<_Fn, _Args...>::value; template