diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2019-10-30 16:57:13 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2019-10-30 16:57:13 +0000 |
commit | 0d58d88db68e190f9dfae241a806086872ef1d10 (patch) | |
tree | 8feaa97ad772bdb43493d62c567891602b25a4d0 /libstdc++-v3 | |
parent | 43f1814cf15f0d92bb7a41ab4e38ac83dc3fec74 (diff) | |
download | gcc-0d58d88db68e190f9dfae241a806086872ef1d10.zip gcc-0d58d88db68e190f9dfae241a806086872ef1d10.tar.gz gcc-0d58d88db68e190f9dfae241a806086872ef1d10.tar.bz2 |
Fix some missing/incorrect feature test macros
* include/std/bit (__cpp_lib_bitops): Define.
* include/std/version (__cpp_lib_constexpr): Remove.
(__cpp_lib_bitops, __cpp_lib_constexpr_dynamic_alloc): Define.
* testsuite/26_numerics/bit/header.cc: New test.
* testsuite/26_numerics/bit/header-2.cc: New test.
* testsuite/20_util/allocator_traits/header.cc: New test.
* testsuite/20_util/allocator_traits/header-2.cc: New test.
From-SVN: r277633
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 8 | ||||
-rw-r--r-- | libstdc++-v3/include/std/bit | 2 | ||||
-rw-r--r-- | libstdc++-v3/include/std/version | 5 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/20_util/allocator_traits/header-2.cc | 27 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/20_util/allocator_traits/header.cc | 27 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/26_numerics/bit/header-2.cc | 27 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/26_numerics/bit/header.cc | 27 |
7 files changed, 121 insertions, 2 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 7d7159a..643c4ac 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,13 @@ 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, __cpp_lib_constexpr_dynamic_alloc): Define. + * testsuite/26_numerics/bit/header.cc: New test. + * testsuite/26_numerics/bit/header-2.cc: New test. + * testsuite/20_util/allocator_traits/header.cc: New test. + * testsuite/20_util/allocator_traits/header-2.cc: New test. + * include/bits/stl_iterator.h (namespace __gnu_cxx): Remove using-declarations for std::iterator and std::iterator_traits. (__gnu_cxx::__normal_iterator): Qualify iterator_traits. diff --git a/libstdc++-v3/include/std/bit b/libstdc++-v3/include/std/bit index 914cdfe..e89bca2 100644 --- a/libstdc++-v3/include/std/bit +++ b/libstdc++-v3/include/std/bit @@ -263,6 +263,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #if __cplusplus > 201703L +#define __cpp_lib_bitops 201907L + /// @cond undoc template<typename _Tp, typename _Up = _Tp> using _If_is_unsigned_integer diff --git a/libstdc++-v3/include/std/version b/libstdc++-v3/include/std/version index ccaedd0..a01a8b2 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 @@ -152,12 +152,13 @@ // c++2a #define __cpp_lib_atomic_ref 201806L #define __cpp_lib_bind_front 201907L +#define __cpp_lib_bitops 201907L #define __cpp_lib_bounded_array_traits 201902L #if __cpp_concepts # define __cpp_lib_concepts 201806L #endif -#define __cpp_lib_constexpr 201711L #define __cpp_lib_constexpr_algorithms 201806L +#define __cpp_lib_constexpr_dynamic_alloc 201907L #define __cpp_lib_constexpr_invoke 201907L #if __cpp_impl_destroying_delete # define __cpp_lib_destroying_delete 201806L diff --git a/libstdc++-v3/testsuite/20_util/allocator_traits/header-2.cc b/libstdc++-v3/testsuite/20_util/allocator_traits/header-2.cc new file mode 100644 index 0000000..e43b6f9 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/allocator_traits/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_constexpr_dynamic_alloc +# error "Feature test macro for constexpr_dynamic_alloc is missing in <version>" +#elif __cpp_lib_constexpr_dynamic_alloc < 201907L +# error "Feature test macro for constexpr_dynamic_alloc has wrong value in <version>" +#endif diff --git a/libstdc++-v3/testsuite/20_util/allocator_traits/header.cc b/libstdc++-v3/testsuite/20_util/allocator_traits/header.cc new file mode 100644 index 0000000..6687929 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/allocator_traits/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 <memory> + +#ifndef __cpp_lib_constexpr_dynamic_alloc +# error "Feature test macro for constexpr_dynamic_alloc is missing in <memory>" +#elif __cpp_lib_constexpr_dynamic_alloc < 201907L +# error "Feature test macro for constexpr_dynamic_alloc has wrong value in <memory>" +#endif 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 0000000..f67a1cd --- /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 0000000..824ee00 --- /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 |