From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 8A1AA398B846 for ; Wed, 18 Aug 2021 14:41:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8A1AA398B846 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-466-0Hmx2LlrOnqVXcHyfHaJEA-1; Wed, 18 Aug 2021 10:41:56 -0400 X-MC-Unique: 0Hmx2LlrOnqVXcHyfHaJEA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C428B8015C7; Wed, 18 Aug 2021 14:41:55 +0000 (UTC) Received: from localhost (unknown [10.33.36.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 63CA719D9B; Wed, 18 Aug 2021 14:41:55 +0000 (UTC) Date: Wed, 18 Aug 2021 15:41:54 +0100 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Enable doxygen processing for C++20 components Message-ID: MIME-Version: 1.0 X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="sgCvV/KB6H2MDNeU" Content-Disposition: inline X-Spam-Status: No, score=-14.2 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_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2021 14:42:08 -0000 --sgCvV/KB6H2MDNeU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Improve grouping, add @since and @deprecated information. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * doc/doxygen/user.cfg.in (PREDEFINED): Enable doxygen processing for C++20 components and components that depend on compiler features. * include/bits/stl_algo.h (random_shuffle): Use @deprecated. * include/std/type_traits: Improve doxygen comments for C++20 traits. Tested powerpc64le-linux. Committed to trunk. --sgCvV/KB6H2MDNeU Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="patch.txt" commit aba938d6c3525450e70fe26e7d92a70761a5ba8e Author: Jonathan Wakely Date: Tue Aug 17 20:27:02 2021 libstdc++: Enable doxygen processing for C++20 components Improve grouping, add @since and @deprecated information. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * doc/doxygen/user.cfg.in (PREDEFINED): Enable doxygen processing for C++20 components and components that depend on compiler features. * include/bits/stl_algo.h (random_shuffle): Use @deprecated. * include/std/type_traits: Improve doxygen comments for C++20 traits. diff --git a/libstdc++-v3/doc/doxygen/user.cfg.in b/libstdc++-v3/doc/doxygen/user.cfg.in index 349b9ec9c36..ab9e552701c 100644 --- a/libstdc++-v3/doc/doxygen/user.cfg.in +++ b/libstdc++-v3/doc/doxygen/user.cfg.in @@ -2384,7 +2384,7 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = __cplusplus=201703L \ +PREDEFINED = __cplusplus=202002L \ __GTHREADS \ _GLIBCXX_HAS_GTHREADS \ _GLIBCXX_HAVE_TLS \ @@ -2427,6 +2427,13 @@ PREDEFINED = __cplusplus=201703L \ __cpp_exceptions \ __cpp_rtti \ __cpp_inline_variables \ + __cpp_constexpr_dynamic_alloc \ + __cpp_aligned_new \ + __cpp_sized_deallocation \ + __cpp_concepts=209900 \ + __cpp_deduction_guides=209900 \ + __cpp_impl_three_way_comparison=209900 \ + __cpp_impl_coroutine \ ATOMIC_INT_LOCK_FREE=2 \ PB_DS_DATA_TRUE_INDICATOR \ PB_DS_STATIC_ASSERT=// \ @@ -2448,8 +2455,15 @@ PREDEFINED = __cplusplus=201703L \ "_GLIBCXX20_DEPRECATED(E)= " \ "_GLIBCXX20_DEPRECATED(E)= " \ _GLIBCXX17_INLINE=inline \ - _GLIBCXX_CHRONO_INT64_T=int64_t \ - _GLIBCXX_DEFAULT_ABI_TAG + _GLIBCXX_CHRONO_INT64_T=int64_t \ + _GLIBCXX_DEFAULT_ABI_TAG \ + _GLIBCXX_USE_DEPRECATED \ + _GLIBCXX_HOSTED \ + "__has_builtin(x)=1" \ + _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP \ + _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE \ + _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED \ + _GLIBCXX_HAVE_BUILTIN_LAUNDER \ # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h index ac4f2d0f721..5d12972ce2c 100644 --- a/libstdc++-v3/include/bits/stl_algo.h +++ b/libstdc++-v3/include/bits/stl_algo.h @@ -4545,6 +4545,10 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO * Reorder the elements in the range @p [__first,__last) using a random * distribution, so that every possible ordering of the sequence is * equally likely. + * + * @deprecated + * Since C++14 `std::random_shuffle` is not part of the C++ standard. + * Use `std::shuffle` instead, which was introduced in C++11. */ template _GLIBCXX14_DEPRECATED_SUGGEST("std::shuffle") @@ -4581,6 +4585,10 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO * provide a random distribution. Calling @p __rand(N) for a positive * integer @p N should return a randomly chosen integer from the * range [0,N). + * + * @deprecated + * Since C++14 `std::random_shuffle` is not part of the C++ standard. + * Use `std::shuffle` instead, which was introduced in C++11. */ template _GLIBCXX14_DEPRECATED_SUGGEST("std::shuffle") diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 2be4944e2a6..15718000800 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -551,7 +551,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { }; /// __is_nullptr_t (deprecated extension). - /// @deprecated Use `is_null_pointer` instead. + /// @deprecated Non-standard. Use `is_null_pointer` instead. template struct __is_nullptr_t : public is_null_pointer<_Tp> @@ -732,8 +732,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION "template argument must be a complete class or an unbounded array"); }; - /** is_pod (deprecated in C++20) - * @deprecated Use `is_standard_layout && is_trivial` instead. + /** is_pod + * @deprecated Deprecated in C++20. + * Use `is_standard_layout && is_trivial` instead. */ // Could use is_standard_layout && is_trivial instead of the builtin. template @@ -747,7 +748,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION }; /** is_literal_type - * @deprecated Deprecated in C++20. The idea of a literal type isn't useful. + * @deprecated Deprecated in C++17, removed in C++20. + * The idea of a literal type isn't useful. */ template struct @@ -3097,7 +3099,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * Each variable `is_xxx_v` is a boolean constant with the same value * as the `value` member of the corresponding type trait `is_xxx`. * - * @since C++17 + * @since C++17 unless noted otherwise. */ /** @@ -3286,6 +3288,7 @@ template #ifdef _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP # define __cpp_lib_has_unique_object_representations 201606 /// has_unique_object_representations + /// @since C++17 template struct has_unique_object_representations : bool_constant<__has_unique_object_representations( @@ -3305,6 +3308,7 @@ template #ifdef _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE # define __cpp_lib_is_aggregate 201703 /// is_aggregate + /// @since C++17 template struct is_aggregate : bool_constant<__is_aggregate(remove_cv_t<_Tp>)> @@ -3316,10 +3320,14 @@ template #endif #endif // C++17 -#if __cplusplus > 201703L +#if __cplusplus >= 202002L + + /** * Remove references and cv-qualifiers. + * @since C++20 + * @{ + */ #define __cpp_lib_remove_cvref 201711L - /// Remove references and cv-qualifiers. template struct remove_cvref : remove_cv<_Tp> @@ -3337,18 +3345,26 @@ template template using remove_cvref_t = typename remove_cvref<_Tp>::type; + /// @} + /** * Identity metafunction. + * @since C++20 + * @{ + */ #define __cpp_lib_type_identity 201806L - /// Identity metafunction. template struct type_identity { using type = _Tp; }; template using type_identity_t = typename type_identity<_Tp>::type; + /// @} #define __cpp_lib_unwrap_ref 201811L - /// Unwrap a reference_wrapper + /** Unwrap a reference_wrapper + * @since C++20 + * @{ + */ template struct unwrap_reference { using type = _Tp; }; @@ -3357,34 +3373,43 @@ template template using unwrap_reference_t = typename unwrap_reference<_Tp>::type; + /// @} - /// Decay type and if it's a reference_wrapper, unwrap it + /** Decay type and if it's a reference_wrapper, unwrap it + * @since C++20 + * @{ + */ template struct unwrap_ref_decay { using type = unwrap_reference_t>; }; template using unwrap_ref_decay_t = typename unwrap_ref_decay<_Tp>::type; + /// @} #define __cpp_lib_bounded_array_traits 201902L /// True for a type that is an array of known bound. + /// @since C++20 template struct is_bounded_array : public __is_array_known_bounds<_Tp> { }; /// True for a type that is an array of unknown bound. + /// @since C++20 template struct is_unbounded_array : public __is_array_unknown_bounds<_Tp> { }; /// @ingroup variable_templates + /// @since C++20 template inline constexpr bool is_bounded_array_v = is_bounded_array<_Tp>::value; /// @ingroup variable_templates + /// @since C++20 template inline constexpr bool is_unbounded_array_v = is_unbounded_array<_Tp>::value; @@ -3419,8 +3444,8 @@ template #if __cplusplus > 202002L #define __cpp_lib_is_scoped_enum 202011L + /// True if the type is a scoped enumeration type. /// @since C++23 - //@{ template struct is_scoped_enum @@ -3443,11 +3468,11 @@ template : bool_constant { }; - /** - * @ingroup variable_templates - */ + /// @ingroup variable_templates + /// @since C++23 template inline constexpr bool is_scoped_enum_v = is_scoped_enum<_Tp>::value; + #endif // C++23 #ifdef _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED @@ -3455,10 +3480,10 @@ template #define __cpp_lib_is_constant_evaluated 201811L /// Returns true only when called during constant evaluation. + /// @since C++20 constexpr inline bool is_constant_evaluated() noexcept { return __builtin_is_constant_evaluated(); } - /// @} #endif /// @cond undocumented --sgCvV/KB6H2MDNeU--