From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1464) id 257603857811; Fri, 4 Sep 2020 19:05:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 257603857811 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1599246321; bh=pnAm+BftR/oAoTEgMGk4gP0GD846qgfjERnT20udBUM=; h=From:To:Subject:Date:From; b=eL1IY9RashQCNTxeGKRXfEcos1RCg5dHuGN+wKUb6OBji01YY1Gf2C59Vo4BbItcw nBS2ntbqP732kaap68tUiwsI1LIt0oh72DPcmk+o8ZaT6i0HL91Y+lgjdDW64eHsZ5 Ik3MsTB26aw+kuIy9nh2V4NnQMm17LnR2R0cDeko= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Peter Bergner To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/ibm/heads/gcc-9-branch)] libstdc++: Add __cpp_lib_unwrap_ref feature test macro X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/vendors/ibm/heads/gcc-9-branch X-Git-Oldrev: 8b3cd6da5b5df7e244a5a590ccb530562802a389 X-Git-Newrev: 8079a9ab972b1fc8618a30f0a42a6533810e1c07 Message-Id: <20200904190521.257603857811@sourceware.org> Date: Fri, 4 Sep 2020 19:05:21 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Sep 2020 19:05:21 -0000 https://gcc.gnu.org/g:8079a9ab972b1fc8618a30f0a42a6533810e1c07 commit 8079a9ab972b1fc8618a30f0a42a6533810e1c07 Author: Jonathan Wakely Date: Wed Feb 19 15:06:24 2020 +0000 libstdc++: Add __cpp_lib_unwrap_ref feature test macro We already defined the traits in as now required by LWG 3348, but the macro was missing. This adds it. Backport from mainline 2020-02-19 Jonathan Wakely * include/std/type_traits (__cpp_lib_unwrap_ref): Define (LWG 3348). * include/std/version (__cpp_lib_unwrap_ref): Likewise. * testsuite/20_util/unwrap_reference/1.cc: Check macro. * testsuite/20_util/unwrap_reference/3.cc: New test. Diff: --- libstdc++-v3/ChangeLog | 10 ++++++++ libstdc++-v3/include/std/type_traits | 2 ++ libstdc++-v3/include/std/version | 1 + .../testsuite/20_util/unwrap_reference/1.cc | 6 +++++ .../testsuite/20_util/unwrap_reference/3.cc | 27 ++++++++++++++++++++++ 5 files changed, 46 insertions(+) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 616b154e866..a5d92e5ae21 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,13 @@ +2020-04-23 Jonathan Wakely + + Backport from mainline + 2020-02-19 Jonathan Wakely + + * include/std/type_traits (__cpp_lib_unwrap_ref): Define (LWG 3348). + * include/std/version (__cpp_lib_unwrap_ref): Likewise. + * testsuite/20_util/unwrap_reference/1.cc: Check macro. + * testsuite/20_util/unwrap_reference/3.cc: New test. + 2020-04-22 Jonathan Wakely * doc/Makefile.am (xml_sources_manual): Add missing XML files. diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 9bad55829ce..993f7e3153c 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -3044,6 +3044,8 @@ template template using type_identity_t = typename type_identity<_Tp>::type; +#define __cpp_lib_unwrap_ref 201811L + /// Unwrap a reference_wrapper template struct unwrap_reference { using type = _Tp; }; diff --git a/libstdc++-v3/include/std/version b/libstdc++-v3/include/std/version index 9dc7cbbb184..39b49371370 100644 --- a/libstdc++-v3/include/std/version +++ b/libstdc++-v3/include/std/version @@ -161,6 +161,7 @@ # define __cpp_lib_is_constant_evaluated 201811L #endif #define __cpp_lib_list_remove_return_type 201806L +#define __cpp_lib_unwrap_ref 201811L #endif // C++2a #endif // C++17 #endif // C++14 diff --git a/libstdc++-v3/testsuite/20_util/unwrap_reference/1.cc b/libstdc++-v3/testsuite/20_util/unwrap_reference/1.cc index 243526725a0..3c04028bb6e 100644 --- a/libstdc++-v3/testsuite/20_util/unwrap_reference/1.cc +++ b/libstdc++-v3/testsuite/20_util/unwrap_reference/1.cc @@ -20,6 +20,12 @@ #include +#ifndef __cpp_lib_unwrap_ref +# error "Feature-test macro for unwrap_reference missing in " +#elif __cpp_lib_unwrap_ref != 201811L +# error "Feature-test macro for unwrap_reference has wrong value in " +#endif + template struct expect_same; template struct expect_same : std::true_type { }; diff --git a/libstdc++-v3/testsuite/20_util/unwrap_reference/3.cc b/libstdc++-v3/testsuite/20_util/unwrap_reference/3.cc new file mode 100644 index 00000000000..3ea9cd18a05 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/unwrap_reference/3.cc @@ -0,0 +1,27 @@ +// Copyright (C) 2020 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// { dg-options "-std=gnu++2a" } +// { dg-do compile { target c++2a } } + +#include + +#ifndef __cpp_lib_unwrap_ref +# error "Feature-test macro for unwrap_reference missing in " +#elif __cpp_lib_unwrap_ref != 201811L +# error "Feature-test macro for unwrap_reference has wrong value in " +#endif