From patchwork Mon Jan 15 17:18:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 188269 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2614:b0:101:6a76:bbe3 with SMTP id mm20csp1835942dyc; Mon, 15 Jan 2024 09:19:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IFPULSUbLIXphAjrv+5vmNQIYv6aCeC7bmhaQLvgELD5rjZXslLtVr+g3SChjh61WpnHNvA X-Received: by 2002:a05:6122:1b0c:b0:4b6:ce08:cc76 with SMTP id er12-20020a0561221b0c00b004b6ce08cc76mr3015766vkb.9.1705339170324; Mon, 15 Jan 2024 09:19:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705339170; cv=pass; d=google.com; s=arc-20160816; b=NTFOgIj3c8LfBLqjV7ZXFMgefYPB3AMGQlybxPexcjchD+CAJYFeCW3Ml+DKzayBCx eqEzV4JeccQB8HbaQtj8LEOrjjwlHwGrkmY7k9g880oJ7DNE0dM/PA4seqvEVo9AjBPZ WRr0+juf6PiIf14Fq/yPEQOCk7FHfe8Ob2aAUJ8ImNNhcnPF3parWQ4dbBrTnViwtJAn ar2MzfvvLJJUc/sjxTshG9OigXtwiGufBKMiIOiyvnOEGADvioNds4s3pjeg3WIup3Mm xcyKN20oPozTYFH7XcTV4FGsZd7dMWNVeavKPZvGiAePv3tP+zRinYPOTVkBQohQ7xDV Ps+Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=o33rq5x58rt6/Ydt7EPDNSSD0kSXo5fSr6SKff8MJdM=; fh=sJ+2/4g29YdyXkoRrFZSpsL2zxijepB7X/1rB0LDDh8=; b=wjy/nE8cAdqQ2x29hm5xTu8UHpfnTSJX4QCm5Hl0gJKcxKXxFYuggtcF1pPVRa5WIR cy77T4b3dvvw6+/XQ/hoJnR1Wu1SKG7PLmQCfbDAs1k6byaoZErjfRHvnNQz7s69yk0y ZATkrO3l5/260++1cEwqmhXV5K0HLNH/D66tbS/1O+A/TiV2a8ZwOgXeBT2t4FFwoMaZ ACeWzHeX4W1Ya42HNrAk0buOd+j5googVjjWlymCiTY7ZU4kvndl4bcC3tvKtyEMqabz xa04kBuMoRS87bhvOpcs2T6iGTCHY2Sz9Ggy8rbjzYfly86zNBRjnZsEFqcGwU1Y5UaQ M7LA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NiBprT5a; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id x9-20020a0c8e89000000b0067fc77296a5si8311069qvb.472.2024.01.15.09.19.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 09:19:30 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NiBprT5a; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0ADFB3861833 for ; Mon, 15 Jan 2024 17:19:30 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 8F4603861826 for ; Mon, 15 Jan 2024 17:18:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8F4603861826 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8F4603861826 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705339113; cv=none; b=uWrcJq/Y5ESpoYvVgHTyzOnfNvI/VzCaNoIEGuUHTuT0V/6Kn2VxbE1hIUBl5t/DlR4cTkuEN82v2lZEEQCy69hTAh3Xcn1NvlNjh4aQBPIwXWGGVxqHWBcM24PsOM9pbXy0blY3gg0+dmKEneTIU1z0wcPw3fN2dv+luY2TfhM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705339113; c=relaxed/simple; bh=fYq9lw10wtrLFb3RQbOytirkiCgNbb5iPSnlfkjHCjc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=uZSONZyHIaK27iNhPaQsPr0i/iyc4ztihSn3osrTQDaldrYRMTNwpbnL4j/ndYhc2p0YkElAHED2RtjrY5oWR0YCOXKxNTnHKxjYMpYLu3JWvAdgzcIF+5POy7moPflg0XrKWnpiktu2nuvN8ikW2NeEvuIqpRDpUUP9X+qFsB0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1705339112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o33rq5x58rt6/Ydt7EPDNSSD0kSXo5fSr6SKff8MJdM=; b=NiBprT5aakpq6TWy4SPyxKkylSlRa6QMcsY5IoUrN+YNMofWZLVFtnzVQUQyLhFkrVVrNb mDy/Ep06SINRhj5rqP9e8EbUeAfWxa8yIPCbJZ7Q/cVJ1UsTQOayFGDAW/k0XNyefq1FUv pVSl1h+JWDtPq6I/xmJEYpTKC42JhQk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-662-n0McqjXFN1i3CzxI5m4TyQ-1; Mon, 15 Jan 2024 12:18:30 -0500 X-MC-Unique: n0McqjXFN1i3CzxI5m4TyQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 72A898493ED; Mon, 15 Jan 2024 17:18:30 +0000 (UTC) Received: from localhost (unknown [10.42.28.185]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3CC6240C6EB9; Mon, 15 Jan 2024 17:18:30 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Use variable template to fix -fconcepts-ts error [PR113366] Date: Mon, 15 Jan 2024 17:18:11 +0000 Message-ID: <20240115171829.1500537-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788177726240947871 X-GMAIL-MSGID: 1788177726240947871 Tested x86_64-linux. Pushed to trunk. -- >8 -- There's an error for -fconcepts-ts due to using a concept where a bool NTTP is required, which is fixed by using the vraiable template that already exists in the class scope. This doesn't fix the problem with -fconcepts-ts as changes to the placement of attributes is also needed. libstdc++-v3/ChangeLog: PR testsuite/113366 * include/std/format (basic_format_arg): Use __formattable variable template instead of __format::__formattable_with concept. --- libstdc++-v3/include/std/format | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/include/std/format b/libstdc++-v3/include/std/format index 540f8b805f8..efc4a17ba36 100644 --- a/libstdc++-v3/include/std/format +++ b/libstdc++-v3/include/std/format @@ -3189,8 +3189,7 @@ namespace __format // Format as const if possible, to reduce instantiations. template using __maybe_const_t - = __conditional_t<__format::__formattable_with<_Tp, _Context>, - const _Tp, _Tp>; + = __conditional_t<__formattable<_Tp>, const _Tp, _Tp>; template static void @@ -3208,7 +3207,7 @@ namespace __format explicit handle(_Tp& __val) noexcept { - if constexpr (!__format::__formattable_with) + if constexpr (!__formattable) static_assert(!is_const_v<_Tp>, "std::format argument must be " "non-const for this type");