From patchwork Wed Aug 31 13:38:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 869 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:ecc5:0:0:0:0:0 with SMTP id s5csp235841wro; Wed, 31 Aug 2022 06:40:55 -0700 (PDT) X-Google-Smtp-Source: AA6agR4cOrxFzgs7Kv9HCMgYYxQKHk5t7ipgSYXdKWzRVigKRbQBRx9AbrssxG5T8wU3XFwhi6bG X-Received: by 2002:a17:907:7612:b0:741:6559:de26 with SMTP id jx18-20020a170907761200b007416559de26mr12376193ejc.582.1661953255269; Wed, 31 Aug 2022 06:40:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661953255; cv=none; d=google.com; s=arc-20160816; b=wRucCul3wQLrOlbrwVoXmOYkN/3glyaZZrfnHHHPwQpgtx0T+KoV07t25SYHpuHcQP J8e/1Mf0MZ8mwMRWg0jx69/zurYWOEBrgTs/6csiybP7PYzGod6NIE2uMw2Pp+4UfB/S LuimwNv53lxkk6RC2bvk8CyPdsuW0VS1nT5Kl5qrTkzOA3WSYSgIxERt1sMlD2irqO6H IchZtWd91OytAbztHT5vMyWQouDq2kJSA+preII5GiGtp9C9NyGSi1KL9oUkFtbOEbjk Ov4nZ7L5l8xOjRkGGaM2ZrF5+5Xi1Yx0mOsuyQ9M1DIKuCxYit03mJ3bdA69DNp+n23W 9BHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=CJ0ckdTE7rVy0NC0Vo+2VeXE4t39BOnUTnjfRPLGnmY=; b=RG3B294G4VS8urVGEwcKWx4mMD0hErgDAg+H3Nk/eog3LT/g3wx2uWCUmXlWKxqkca K3HiDzwaVilCJsTG/SH6kNp3E3QijpRuQ7Ovd6M9t9jJXUOBMEN9Xxc/JPYTxyPxMwyq 7gX5VkCOdtODcKdZ624O7lGKV237q1pzKbQP1boWuGE7STnKtAdTJ332sNqiWBaXSgiT 9RwtlbpEKHVEVv4m96HkoDDlwNIl1tqQ2w2L6QlxYGooMsvqAX7Dq/gIyEwl528orlLG totCqgKSwSe+OOHPYaBNnC6tQ7ybp1gDaku+7/JNRsRldbxkZI8IXGRJYD991ZKp7kwP z4yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=f7uUHvql; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id r19-20020a05640251d300b0043bbb19a3b4si13097969edd.174.2022.08.31.06.40.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Aug 2022 06:40:55 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=f7uUHvql; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2DA9038233F2 for ; Wed, 31 Aug 2022 13:39:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2DA9038233F2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661953190; bh=CJ0ckdTE7rVy0NC0Vo+2VeXE4t39BOnUTnjfRPLGnmY=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=f7uUHvqljsMQXjo1SZclgH9QDEmoMJK09QlbcH6hQ9B/0WrMpw2DOxs6daXFnSETT ObNqIufjCN2t7J8t9MUSI6mvWvSEf/GpG08PPQvjeqA8b62F0n0BNkk89hVk+XvTw5 L2pTZ/Vayqigft8W9L7zRTpf7InqVt93xJRoJQzc= 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 7500C383E044 for ; Wed, 31 Aug 2022 13:39:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7500C383E044 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-548-uTQPBDJhNN2KqzIf28Q_cg-1; Wed, 31 Aug 2022 09:38:58 -0400 X-MC-Unique: uTQPBDJhNN2KqzIf28Q_cg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C91C080A0C2; Wed, 31 Aug 2022 13:38:57 +0000 (UTC) Received: from localhost (unknown [10.33.36.187]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8FC381415117; Wed, 31 Aug 2022 13:38:57 +0000 (UTC) To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Improve comments in std::reference_wrapper tests Date: Wed, 31 Aug 2022 14:38:56 +0100 Message-Id: <20220831133856.63223-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jonathan Wakely via Gcc-patches From: Jonathan Wakely Reply-To: Jonathan Wakely Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1742684296377589468?= X-GMAIL-MSGID: =?utf-8?q?1742684296377589468?= Tested x86_64-linux, pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * testsuite/20_util/reference_wrapper/invoke-2.cc: Improve comments. * testsuite/20_util/reference_wrapper/invoke-3.cc: Likewise. * testsuite/20_util/reference_wrapper/invoke.cc: Likewise. --- libstdc++-v3/testsuite/20_util/reference_wrapper/invoke-2.cc | 3 ++- libstdc++-v3/testsuite/20_util/reference_wrapper/invoke-3.cc | 3 ++- libstdc++-v3/testsuite/20_util/reference_wrapper/invoke.cc | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/testsuite/20_util/reference_wrapper/invoke-2.cc b/libstdc++-v3/testsuite/20_util/reference_wrapper/invoke-2.cc index 2741510e756..fd3430cf0a9 100644 --- a/libstdc++-v3/testsuite/20_util/reference_wrapper/invoke-2.cc +++ b/libstdc++-v3/testsuite/20_util/reference_wrapper/invoke-2.cc @@ -16,7 +16,7 @@ // with this library; see the file COPYING3. If not see // . -// 20.6.4 function object return types [func.ret] +// C++11 20.8.3.4 reference_wrapper invocation [refwrap.invoke] #include struct X @@ -27,6 +27,7 @@ struct X void test01() { + // PR libstdc++/48521 std::result_of doesn't work with pointer to member typedef int (X::*mfp)(int); typedef int X::*mp; mfp m = &X::f; diff --git a/libstdc++-v3/testsuite/20_util/reference_wrapper/invoke-3.cc b/libstdc++-v3/testsuite/20_util/reference_wrapper/invoke-3.cc index e4124c9b57c..c25315b6751 100644 --- a/libstdc++-v3/testsuite/20_util/reference_wrapper/invoke-3.cc +++ b/libstdc++-v3/testsuite/20_util/reference_wrapper/invoke-3.cc @@ -17,7 +17,7 @@ // with this library; see the file COPYING3. If not see // . -// 20.8.3.4 reference_wrapper invocation [refwrap.invoke] +// C++11 20.8.3.4 reference_wrapper invocation [refwrap.invoke] #include struct ABC @@ -33,4 +33,5 @@ struct Concrete : ABC Concrete c; ABC& abc = c; +// PR libstdc++/57336 Cannot INVOKE a reference_wrapper around an abstract type auto b = std::cref(abc)(); diff --git a/libstdc++-v3/testsuite/20_util/reference_wrapper/invoke.cc b/libstdc++-v3/testsuite/20_util/reference_wrapper/invoke.cc index cd884fe66eb..b2abc812b79 100644 --- a/libstdc++-v3/testsuite/20_util/reference_wrapper/invoke.cc +++ b/libstdc++-v3/testsuite/20_util/reference_wrapper/invoke.cc @@ -17,6 +17,8 @@ // with this library; see the file COPYING3. If not see // . +// C++11 20.8.3.4 reference_wrapper invocation [refwrap.invoke] + #include #include #include