From patchwork Fri Aug 5 14:20:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 56567 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6A1C9385696D for ; Fri, 5 Aug 2022 14:20:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6A1C9385696D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1659709246; bh=f92zZPoZirBPkgKQ3EiyJ0ZX/S2LxPSkk8uBcFEoTI0=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=PS6Ztx9Kur7w0aY4Kcnd050uVRX867qD6F/8hReyMCKKb2TINMGCA/PYDOwJzcmBZ UAJvq0cIoI8RjFFbIbXEeg7t16ly/XEMaDwokV7C3+9tOeJxtOpQXTttAlbsSFLcCU 8i2J9FeDwmJ2rjw14vUWY8jHPDpaSbxTnkT4JAYY= 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 02C1D385829F for ; Fri, 5 Aug 2022 14:20:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 02C1D385829F Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-422-16qcNkljPbyyYgxJOsaJ8A-1; Fri, 05 Aug 2022 10:20:12 -0400 X-MC-Unique: 16qcNkljPbyyYgxJOsaJ8A-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 682133802BA9; Fri, 5 Aug 2022 14:20:12 +0000 (UTC) Received: from localhost (unknown [10.33.36.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 30F4D2166B26; Fri, 5 Aug 2022 14:20:12 +0000 (UTC) To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Add feature test macro for Date: Fri, 5 Aug 2022 15:20:11 +0100 Message-Id: <20220805142011.853770-1-jwakely@redhat.com> In-Reply-To: <20220805135926.851044-1-jwakely@redhat.com> References: <20220805135926.851044-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.8 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, 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+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" I forgot to add this macro to the new header. Tested x86_64-linux, pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * include/experimental/scope (__cpp_lib_experimental_scope): Define. * testsuite/experimental/scopeguard/uniqueres.cc: Check macro. --- libstdc++-v3/include/experimental/scope | 2 ++ libstdc++-v3/testsuite/experimental/scopeguard/uniqueres.cc | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/libstdc++-v3/include/experimental/scope b/libstdc++-v3/include/experimental/scope index 37a57b38af7..208fadc513e 100644 --- a/libstdc++-v3/include/experimental/scope +++ b/libstdc++-v3/include/experimental/scope @@ -43,6 +43,8 @@ namespace std _GLIBCXX_VISIBILITY(default) _GLIBCXX_BEGIN_NAMESPACE_VERSION namespace experimental::inline fundamentals_v3 { +#define __cpp_lib_experimental_scope 201902 + template concept __not_same_as = !same_as<_Tp, _Up>; diff --git a/libstdc++-v3/testsuite/experimental/scopeguard/uniqueres.cc b/libstdc++-v3/testsuite/experimental/scopeguard/uniqueres.cc index 7690572ab19..fe9d6ee7cfc 100644 --- a/libstdc++-v3/testsuite/experimental/scopeguard/uniqueres.cc +++ b/libstdc++-v3/testsuite/experimental/scopeguard/uniqueres.cc @@ -4,6 +4,12 @@ #include #include +#ifndef __cpp_lib_experimental_scope +# error Feature-test macro is not defined. +#elif __cpp_lib_experimental_scope < 201902 +# error Feature-test macro has bad value. +#endif + using std::experimental::unique_resource; void