diff --git a/groups/bsl/bsl+bslhdrs/bsl_functional.h b/groups/bsl/bsl+bslhdrs/bsl_functional.h index eb1dd3f599..b709618f18 100644 --- a/groups/bsl/bsl+bslhdrs/bsl_functional.h +++ b/groups/bsl/bsl+bslhdrs/bsl_functional.h @@ -27,7 +27,6 @@ BSLS_IDENT("$Id: $") namespace bsl { // Import selected symbols into bsl namespace - using std::binary_negate; using std::divides; using std::greater; using std::greater_equal; @@ -40,13 +39,10 @@ namespace bsl { using std::modulus; using std::multiplies; using std::negate; - using std::not1; - using std::not2; using std::not_equal_to; using std::plus; - using std::unary_negate; -#if ! defined BSLS_LIBRARYFEATURES_HAS_CPP17_DEPRECATED_REMOVED +#if !defined(BSLS_LIBRARYFEATURES_HAS_CPP17_DEPRECATED_REMOVED) // These names are removed by C++17 using std::binary_function; using std::bind1st; @@ -69,6 +65,14 @@ namespace bsl { using std::unary_function; #endif +#if !defined(BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED) + // These names are removed by C++20 + using std::binary_negate; + using std::not1; + using std::not2; + using std::unary_negate; +#endif + #ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY namespace placeholders = std::placeholders; diff --git a/groups/bsl/bsl+bslhdrs/bsl_memory.h b/groups/bsl/bsl+bslhdrs/bsl_memory.h index ced544e342..9b20d64843 100644 --- a/groups/bsl/bsl+bslhdrs/bsl_memory.h +++ b/groups/bsl/bsl+bslhdrs/bsl_memory.h @@ -31,9 +31,6 @@ namespace bsl { // using std::allocator; //.. - using std::get_temporary_buffer; - using std::raw_storage_iterator; - using std::return_temporary_buffer; using std::uninitialized_copy; using std::uninitialized_fill; using std::uninitialized_fill_n; @@ -82,6 +79,12 @@ namespace bsl { using std::undeclare_reachable; #endif // BSLS_LIBRARYFEATURES_HAS_CPP11_GARBAGE_COLLECTION_API +#ifndef BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED + using std::get_temporary_buffer; + using std::raw_storage_iterator; + using std::return_temporary_buffer; +#endif + #ifndef BDE_OMIT_INTERNAL_DEPRECATED // Import additional names expected by existing code, but not mandated by // the standard header. This may get tricky if some standard library diff --git a/groups/bsl/bsl+bslhdrs/bsl_type_traits.h b/groups/bsl/bsl+bslhdrs/bsl_type_traits.h index f78cda01ca..7c23bfb99d 100644 --- a/groups/bsl/bsl+bslhdrs/bsl_type_traits.h +++ b/groups/bsl/bsl+bslhdrs/bsl_type_traits.h @@ -113,11 +113,11 @@ using std::is_object; using std::is_scalar; using std::is_compound; + // 20.10.4.3, type properties: using std::is_trivial; using std::is_standard_layout; -using std::is_pod; -using std::is_literal_type; +using std::is_pod; // deprecated by C++20 using std::is_abstract; using std::is_signed; using std::is_unsigned; @@ -172,19 +172,22 @@ using std::aligned_union; #endif using std::common_type; using std::underlying_type; + +#if !defined(BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED) + // These names are removed by C++20 +using std::is_literal_type; using std::result_of; +#endif #ifdef BSLS_COMPILERFEATURES_SUPPORT_ALIAS_TEMPLATES template -using aligned_storage_t = - typename std::aligned_storage::type; +using aligned_storage_t = typename std::aligned_storage::type; // 'aligned_storage_t' is an alias to the return type of the // 'std::aligned_storage' meta-function. #ifdef BSLS_COMPILERFEATURES_SUPPORT_VARIADIC_TEMPLATES template -using aligned_union_t = - typename std::aligned_union::type; +using aligned_union_t = typename std::aligned_union::type; // 'aligned_union_t' is an alias to the return type of the // 'std::aligned_union' meta-function. @@ -205,22 +208,24 @@ using make_unsigned_t = typename std::make_unsigned::type; // 'std::make_unsigned' meta-function. template -using remove_all_extents_t = - typename std::remove_all_extents::type; +using remove_all_extents_t = typename std::remove_all_extents::type; // 'remove_all_extents_t' is an alias to the return type of the // 'std::remove_all_extents' meta-function. -template -using result_of_t = typename std::result_of::type; - // ' result_of_t' is an alias to the return type of the - // 'std::result_of' meta-function. - template using underlying_type_t = typename std::underlying_type::type; // 'underlying_type_t' is an alias to the return type of the // 'std::underlying_type' meta-function. #endif +#if !defined(BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED) + // These names are removed by C++20 +template +using result_of_t = typename std::result_of::type; + // ' result_of_t' is an alias to the return type of the + // 'std::result_of' meta-function. +# endif + #ifdef BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY using std::is_null_pointer; using std::is_final; @@ -287,50 +292,24 @@ template BSLS_KEYWORD_INLINE_VARIABLE constexpr bool is_standard_layout_v = std::is_standard_layout::value; -// ---------------------------------------------------------------------------- - -#if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 110000 && \ +# if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 110000 && \ BSLS_COMPILERFEATURES_CPLUSPLUS >= 202002L -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wdeprecated-declarations" +# endif template -#if BSLS_COMPILERFEATURES_CPLUSPLUS >= 202002L +# if BSLS_COMPILERFEATURES_CPLUSPLUS >= 202002L BSLA_DEPRECATED // Warn of using 'bsl::is_pod_v' even though we suppress // warnings of using 'std::is_pod' in this implementation. -#endif // C++20 +# endif // C++20 BSLS_KEYWORD_INLINE_VARIABLE constexpr bool is_pod_v = std::is_pod::value; -#if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 110000 && \ +# if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 110000 && \ BSLS_COMPILERFEATURES_CPLUSPLUS >= 202002L -#pragma GCC diagnostic pop -#endif - -// ---------------------------------------------------------------------------- - -#if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 110000 && \ - BSLS_COMPILERFEATURES_CPLUSPLUS >= 201703L -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif - -#if BSLS_COMPILERFEATURES_CPLUSPLUS < 202002L -template -BSLA_DEPRECATED // Warn of using 'bsl::is_literal_type' even though we - // suppress warnings of using 'std::is_pod' in this - // implementation. -BSLS_KEYWORD_INLINE_VARIABLE -constexpr bool is_literal_type_v = std::is_literal_type::value; -#else - // Removed in C++20 -#endif // Introduced in C++17 already deprecated; removed in C++20. - -#if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 110000 && \ - BSLS_COMPILERFEATURES_CPLUSPLUS >= 201703L -#pragma GCC diagnostic pop -#endif +# pragma GCC diagnostic pop +# endif // ---------------------------------------------------------------------------- @@ -470,7 +449,7 @@ template BSLS_KEYWORD_INLINE_VARIABLE constexpr bool is_base_of_v = std::is_base_of::value; -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY +# ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY template BSLS_KEYWORD_INLINE_VARIABLE constexpr bool conjunction_v = std::conjunction::value; @@ -529,8 +508,30 @@ template BSLS_KEYWORD_INLINE_VARIABLE constexpr std::size_t is_nothrow_swappable_with_v = std::is_nothrow_swappable_with::value; -#endif -#endif +# endif // BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY + +# if(!defined BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED) + // These names are removed by C++20 +# if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 110000 +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wdeprecated-declarations" +# endif + +template +BSLA_DEPRECATED // Warn of using 'bsl::is_literal_type' even though we + // suppress warnings of using 'std::is_pod' in this + // implementation. +BSLS_KEYWORD_INLINE_VARIABLE +constexpr bool is_literal_type_v = std::is_literal_type::value; + +# if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION >= 110000 +# pragma GCC diagnostic pop +# endif +# endif // BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED + +#endif // BSLS_COMPILERFEATURES_SUPPORT_VARIABLE_TEMPLATES + +// ---------------------------------------------------------------------------- #if 0 // These traits are provided by BDE, and have additional members for @@ -642,7 +643,7 @@ using std::void_t; #endif // ---------------------------------------------------------------------------- -// Copyright 2019 Bloomberg Finance L.P. +// Copyright 2022 Bloomberg Finance L.P. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/groups/bsl/bsls/bsls_libraryfeatures.h b/groups/bsl/bsls/bsls_libraryfeatures.h index 6f13f87524..881e7dbd1e 100644 --- a/groups/bsl/bsls/bsls_libraryfeatures.h +++ b/groups/bsl/bsls/bsls_libraryfeatures.h @@ -43,6 +43,7 @@ BSLS_IDENT("$Id: $") // BSLS_LIBRARYFEATURES_HAS_CPP17_PMR: // BSLS_LIBRARYFEATURES_HAS_CPP17_TIMESPEC_GET: // BSLS_LIBRARYFEATURES_HAS_CPP17_ALIGNED_ALLOC: +// BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED: more legacy removed // BSLS_LIBRARYFEATURES_STDCPP_GNU: implementation is GNU libstdc++ // BSLS_LIBRARYFEATURES_STDCPP_IBM: implementation is IBM // BSLS_LIBRARYFEATURES_STDCPP_INTELLISENSE: Intellisense is running @@ -376,7 +377,7 @@ BSLS_IDENT("$Id: $") // deprecated in C++14 and will be removed in C++17. // ///'BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY' -///---------------------------------------------------- +///------------------------------------------------- // The 'BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY' macro is used to // identify whether the current platform's standard library supports a baseline // set of C++14 library features (which are defined below). This is especially @@ -445,7 +446,7 @@ BSLS_IDENT("$Id: $") //: o MSVC 2015 // ///'BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY' -///---------------------------------------------------- +///------------------------------------------------- // This macro is used to identify whether the current platform's standard // library supports a baseline set of C++17 library features (which are defined // below). This is especially important in BSL when importing standard library @@ -659,6 +660,17 @@ BSLS_IDENT("$Id: $") // '__cplusplus >= 201703L', standard library implementations often provide // configuration flags to expose the deprecated library features. // +///'BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED' +///--------------------------------------------------- +// The 'BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED' macro is defined for +// libraries that do not export names removed in C++20, such as +// 'std::get_temporary_buffer' and `std::result_of`. +// 'BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED' is generally the +// negation of 'BSLS_LIBRARYFEATURES_HAS_CPP98_AUTO_PTR'. Although the removal +// of deprecated C++20 types is conceptually equivalent to '__cplusplus >= +// 201703L', standard library implementations often provide configuration flags +// to expose the deprecated library features. +// ///'BSLS_LIBRARYFEATURES_HAS_CPP11_PROGRAM_TERMINATION' ///---------------------------------------------------- // The 'BSLS_LIBRARYFEATURES_HAS_CPP11_PROGRAM_TERMINATION' macro is defined if @@ -1083,6 +1095,12 @@ BSLS_IDENT("$Id: $") // keep deprecated functions available. #endif +#if BSLS_COMPILERFEATURES_CPLUSPLUS >= 202002L +#define BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED 1 + // Set when C++20 is detected. Adjusted below for implementations that + // keep deprecated functions available. +#endif + // ============================================================================ // PLATFORM SPECIFIC FEATURE DETECTION // ---------------------------------------------------------------------------- diff --git a/groups/bsl/bsls/bsls_platform.h b/groups/bsl/bsls/bsls_platform.h index d35fee8c74..342f3fd5bb 100644 --- a/groups/bsl/bsls/bsls_platform.h +++ b/groups/bsl/bsls/bsls_platform.h @@ -921,6 +921,7 @@ struct Platform { struct CpuArmv6 : CpuArm {}; struct CpuArmv7 : CpuArm {}; struct CpuArmv8 : CpuArm {}; + struct CpuArmv9 : CpuArm {}; // PLATFORM TRAITS @@ -997,6 +998,10 @@ struct Platform { #if defined(BSLS_PLATFORM_CPU_ARM_V8) typedef CpuArmv8 Cpu; #endif + #if defined(BSLS_PLATFORM_CPU_ARM_V9) + typedef CpuArmv9 Cpu; + #endif + }; } // close package namespace