public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/ibm/heads/gcc-9-branch)] libstdc++: Fix some missing/incorrect feature test macros
@ 2020-09-04 19:05 Peter Bergner
  0 siblings, 0 replies; only message in thread
From: Peter Bergner @ 2020-09-04 19:05 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:906eb61a84c838375952993f4bd46640f29a48cc

commit 906eb61a84c838375952993f4bd46640f29a48cc
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Apr 23 16:56:01 2020 +0100

    libstdc++: Fix some missing/incorrect feature test macros
    
    Backport from mainline
    2019-10-30  Jonathan Wakely  <jwakely@redhat.com>
    
            * include/std/bit (__cpp_lib_bitops): Define.
            * include/std/version (__cpp_lib_constexpr): Remove.
            (__cpp_lib_bitops): Define.
            * testsuite/26_numerics/bit/header.cc: New test.
            * testsuite/26_numerics/bit/header-2.cc: New test.

Diff:
---
 libstdc++-v3/ChangeLog                             |  8 +++++++
 libstdc++-v3/include/std/bit                       |  2 ++
 libstdc++-v3/include/std/version                   |  3 ++-
 libstdc++-v3/testsuite/26_numerics/bit/header-2.cc | 27 ++++++++++++++++++++++
 libstdc++-v3/testsuite/26_numerics/bit/header.cc   | 27 ++++++++++++++++++++++
 5 files changed, 66 insertions(+), 1 deletion(-)

diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index a5d92e5ae21..fe2040a20c2 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,5 +1,13 @@
 2020-04-23  Jonathan Wakely  <jwakely@redhat.com>
 
+	Backport from mainline
+	2019-10-30  Jonathan Wakely  <jwakely@redhat.com>
+
+	* include/std/bit (__cpp_lib_bitops): Define.
+	* include/std/version (__cpp_lib_bitops): Define.
+	* testsuite/26_numerics/bit/header.cc: New test.
+	* testsuite/26_numerics/bit/header-2.cc: New test.
+
 	Backport from mainline
 	2020-02-19  Jonathan Wakely  <jwakely@redhat.com>
 
diff --git a/libstdc++-v3/include/std/bit b/libstdc++-v3/include/std/bit
index c753e39b64a..7d5e575722c 100644
--- a/libstdc++-v3/include/std/bit
+++ b/libstdc++-v3/include/std/bit
@@ -250,6 +250,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
 #if __cplusplus > 201703L
 
+#define __cpp_lib_bitops 201907L
+
   template<typename _Tp, typename _Up, bool = is_integral_v<_Tp>>
     struct _If_is_unsigned_integer_type { };
 
diff --git a/libstdc++-v3/include/std/version b/libstdc++-v3/include/std/version
index 39b49371370..a61fe086240 100644
--- a/libstdc++-v3/include/std/version
+++ b/libstdc++-v3/include/std/version
@@ -107,7 +107,7 @@
 # define __cpp_lib_has_unique_object_representations 201606
 #endif
 #define __cpp_lib_hypot 201603
-#define __cpp_lib_invoke 201411
+#define __cpp_lib_invoke 201411L
 #ifdef _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE
 # define __cpp_lib_is_aggregate 201703
 #endif
@@ -150,6 +150,7 @@
 #if __cplusplus > 201703L
 // c++2a
 #define __cpp_lib_bind_front 201907L
+#define __cpp_lib_bitops 201907L
 #define __cpp_lib_bounded_array_traits 201902L
 #if __cpp_impl_destroying_delete
 # define __cpp_lib_destroying_delete 201806L
diff --git a/libstdc++-v3/testsuite/26_numerics/bit/header-2.cc b/libstdc++-v3/testsuite/26_numerics/bit/header-2.cc
new file mode 100644
index 00000000000..f67a1cdcac1
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/bit/header-2.cc
@@ -0,0 +1,27 @@
+// Copyright (C) 2019 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
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++2a" }
+// { dg-do compile { target c++2a } }
+
+#include <version>
+
+#ifndef __cpp_lib_bitops
+# error "Feature test macro for bitops is missing in <version>"
+#elif __cpp_lib_bitops < 201907L
+# error "Feature test macro for bitops has wrong value in <version>"
+#endif
diff --git a/libstdc++-v3/testsuite/26_numerics/bit/header.cc b/libstdc++-v3/testsuite/26_numerics/bit/header.cc
new file mode 100644
index 00000000000..824ee002e96
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/bit/header.cc
@@ -0,0 +1,27 @@
+// Copyright (C) 2019 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
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++2a" }
+// { dg-do compile { target c++2a } }
+
+#include <bit>
+
+#ifndef __cpp_lib_bitops
+# error "Feature test macro for bitops is missing in <bit>"
+#elif __cpp_lib_bitops < 201907L
+# error "Feature test macro for bitops has wrong value in <bit>"
+#endif


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-04 19:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-04 19:05 [gcc(refs/vendors/ibm/heads/gcc-9-branch)] libstdc++: Fix some missing/incorrect feature test macros Peter Bergner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).