From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id D054B3857413; Wed, 11 Aug 2021 15:42:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D054B3857413 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r11-8845] libstdc++: Improve Doxygen documentation groups [PR 101258] X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/releases/gcc-11 X-Git-Oldrev: fcb9be628e5deadfd01743888b2577833ef868c0 X-Git-Newrev: 63758bead0337b5225016711bf9d540cf7cc80b1 Message-Id: <20210811154227.D054B3857413@sourceware.org> Date: Wed, 11 Aug 2021 15:42:27 +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: Wed, 11 Aug 2021 15:42:27 -0000 https://gcc.gnu.org/g:63758bead0337b5225016711bf9d540cf7cc80b1 commit r11-8845-g63758bead0337b5225016711bf9d540cf7cc80b1 Author: Jonathan Wakely Date: Wed Jun 30 16:00:58 2021 +0100 libstdc++: Improve Doxygen documentation groups [PR 101258] This defines some new Doxygen groups for C++17 variable templates and for the contents of . By documenting the group as a whole and adding each template to a group we don't need to document them individually. Also mark more internals with "@cond undocumented" so that Doxygen ignores them by default. Also make Doxygen process . For some reason, many of the class templates in do not appear in the "Metaprogramming" group. For example, add_cv, remove_extent, and all the is_xxx_constructible and is_xxx_assignable traits. For some reason, Doxygen doesn't include them in the group, despite doing it correctly for other traits in the same header. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: PR libstdc++/101258 * doc/doxygen/user.cfg.in (INPUT): Add . (COLS_IN_ALPHA_INDEX): Remove obsolete tag. (PREDEFINED): Add/fix some more macros that need to be expanded. * include/bits/random.h: Stop Doxygen from documenting internal implementation details. * include/bits/random.tcc: Likewise. * include/bits/this_thread_sleep.h: Fix @file name. * include/experimental/bits/simd.h: Add to Doxygen group. Do not document internal implementation details. * include/experimental/bits/simd_detail.h: Do not document internal implementation details. * include/experimental/simd: Define Doxygen groups. * include/experimental/type_traits: Improve documentation for the header file. Define groups. Use @since commands. * include/std/scoped_allocator (scoped_allocator_adaptor): Move declaration before undocumented region. * include/std/type_traits (true_type, false_type): Use using declaration instead of typedef. (is_invocable_v, is_nothrow_invocable_v, is_invocable_r_v) (is_nothrow_invocable_r_v): Move definitions next to other C++17 variable templates. Do not document internal implementation details. Move misplaced group-end command. Define group for variable templates. * include/std/variant: Do not document internal implementation details. * testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error line number. (cherry picked from commit 6963c3b9ed1308bf5d2d8877956e56fec92853a7) Diff: --- libstdc++-v3/doc/doxygen/user.cfg.in | 21 +- libstdc++-v3/include/bits/random.h | 6 +- libstdc++-v3/include/bits/random.tcc | 6 +- libstdc++-v3/include/bits/this_thread_sleep.h | 2 +- libstdc++-v3/include/experimental/bits/simd.h | 12 ++ .../include/experimental/bits/simd_detail.h | 3 + libstdc++-v3/include/experimental/simd | 17 ++ libstdc++-v3/include/experimental/type_traits | 37 +++- libstdc++-v3/include/std/scoped_allocator | 8 +- libstdc++-v3/include/std/type_traits | 225 +++++++++++++++------ libstdc++-v3/include/std/variant | 4 + .../testsuite/26_numerics/random/pr60037-neg.cc | 2 +- 12 files changed, 259 insertions(+), 84 deletions(-) diff --git a/libstdc++-v3/doc/doxygen/user.cfg.in b/libstdc++-v3/doc/doxygen/user.cfg.in index 4be2e19ce50..2c7df479a25 100644 --- a/libstdc++-v3/doc/doxygen/user.cfg.in +++ b/libstdc++-v3/doc/doxygen/user.cfg.in @@ -1013,6 +1013,7 @@ INPUT = @srcdir@/doc/doxygen/doxygroups.cc \ include/experimental/ratio \ include/experimental/regex \ include/experimental/set \ + include/experimental/simd \ include/experimental/string \ include/experimental/string_view \ include/experimental/system_error \ @@ -1334,13 +1335,6 @@ CLANG_DATABASE_PATH = ALPHABETICAL_INDEX = YES -# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in -# which the alphabetical index list will be split. -# Minimum value: 1, maximum value: 20, default value: 5. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -COLS_IN_ALPHA_INDEX = 2 - # In case all classes in a project start with a common prefix, all classes will # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag # can be used to specify a prefix (or a list of prefixes) that should be ignored @@ -2415,7 +2409,8 @@ PREDEFINED = __cplusplus=201703L \ "_GLIBCXX_END_NAMESPACE_CXX11= " \ "_GLIBCXX_END_NAMESPACE_LDBL= " \ "_GLIBCXX_TEMPLATE_ARGS=... " \ - _GLIBCXX_DEPRECATED \ + "_GLIBCXX_DEPRECATED= " \ + "_GLIBCXX_DEPRECATED_SUGGEST(E)= " \ _GLIBCXX_CONSTEXPR=constexpr \ _GLIBCXX_USE_CONSTEXPR=constexpr \ "_GLIBCXX_THROW(E)= " \ @@ -2430,6 +2425,7 @@ PREDEFINED = __cplusplus=201703L \ _GLIBCXX_USE_NANOSLEEP \ __cpp_exceptions \ __cpp_rtti \ + __cpp_inline_variables \ ATOMIC_INT_LOCK_FREE=2 \ PB_DS_DATA_TRUE_INDICATOR \ PB_DS_STATIC_ASSERT=// \ @@ -2440,11 +2436,16 @@ PREDEFINED = __cplusplus=201703L \ __glibcxx_class_requires2=// \ __glibcxx_class_requires3=// \ __glibcxx_class_requires4=// \ - "__attribute__(X)=" \ + "__attribute__(X)= " \ _GLIBCXX14_CONSTEXPR=constexpr \ _GLIBCXX17_CONSTEXPR=constexpr \ _GLIBCXX20_CONSTEXPR=constexpr \ - _GLIBCXX17_DEPRECATED= \ + "_GLIBCXX11_DEPRECATED= " \ + "_GLIBCXX11_DEPRECATED_SUGGEST(E)= " \ + "_GLIBCXX17_DEPRECATED= " \ + "_GLIBCXX17_DEPRECATED_SUGGEST(E)= " \ + "_GLIBCXX20_DEPRECATED(E)= " \ + "_GLIBCXX20_DEPRECATED(E)= " \ _GLIBCXX17_INLINE=inline # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this diff --git a/libstdc++-v3/include/bits/random.h b/libstdc++-v3/include/bits/random.h index 1b9cc5f16a9..941fa9858c2 100644 --- a/libstdc++-v3/include/bits/random.h +++ b/libstdc++-v3/include/bits/random.h @@ -60,9 +60,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _RealType generate_canonical(_UniformRandomNumberGenerator& __g); - /* - * Implementation-space details. - */ + /// @cond undocumented + // Implementation-space details. namespace __detail { template; } // namespace __detail + /// @endcond /** * @addtogroup random_generators Random Number Generators diff --git a/libstdc++-v3/include/bits/random.tcc b/libstdc++-v3/include/bits/random.tcc index 1357e181874..4c00b119549 100644 --- a/libstdc++-v3/include/bits/random.tcc +++ b/libstdc++-v3/include/bits/random.tcc @@ -36,9 +36,8 @@ namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION - /* - * (Further) implementation-space details. - */ + /// @cond undocumented + // (Further) implementation-space details. namespace __detail { // General case for x = (ax + c) mod m -- use Schrage's algorithm @@ -90,6 +89,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } } // namespace __detail + /// @endcond template constexpr _UIntType diff --git a/libstdc++-v3/include/bits/this_thread_sleep.h b/libstdc++-v3/include/bits/this_thread_sleep.h index a87da388ec5..bdcd0cdeb77 100644 --- a/libstdc++-v3/include/bits/this_thread_sleep.h +++ b/libstdc++-v3/include/bits/this_thread_sleep.h @@ -22,7 +22,7 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . -/** @file bits/std_thread_sleep.h +/** @file bits/this_thread_sleep.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{thread} */ diff --git a/libstdc++-v3/include/experimental/bits/simd.h b/libstdc++-v3/include/experimental/bits/simd.h index 59ddf3cc958..421c923e7b0 100644 --- a/libstdc++-v3/include/experimental/bits/simd.h +++ b/libstdc++-v3/include/experimental/bits/simd.h @@ -45,6 +45,9 @@ #include #endif +/** @ingroup ts_simd + * @{ + */ /* There are several closely related types, with the following naming * convention: * _Tp: vectorizable (arithmetic) type (or any type) @@ -3976,6 +3979,7 @@ template // }}} +/// @cond undocumented // _SmartReference {{{ template @@ -4257,6 +4261,7 @@ template struct __deduce_impl : public __deduce_fixed_size_fallback<_Tp, _Np> {}; //}}}1 +/// @endcond // simd_mask {{{ template @@ -4604,6 +4609,7 @@ template // }}} +/// @cond undocumented // __data(simd_mask) {{{ template _GLIBCXX_SIMD_INTRINSIC constexpr const auto& @@ -4616,6 +4622,7 @@ template { return __x._M_data; } // }}} +/// @endcond // simd_mask reductions [simd_mask.reductions] {{{ template @@ -4758,6 +4765,7 @@ find_last_set(_ExactBool) // }}} +/// @cond undocumented // _SimdIntOperators{{{1 template class _SimdIntOperators {}; @@ -4878,6 +4886,7 @@ template }; //}}}1 +/// @endcond // simd {{{ template @@ -5153,6 +5162,7 @@ template }; // }}} +/// @cond undocumented // __data {{{ template _GLIBCXX_SIMD_INTRINSIC constexpr const auto& @@ -5190,7 +5200,9 @@ template _Ap::_SimdImpl::_S_bit_and(__data(__a), __data(__b))}; } } // namespace __float_bitwise_operators }}} +/// @endcond +/// @} _GLIBCXX_SIMD_END_NAMESPACE #endif // __cplusplus >= 201703L diff --git a/libstdc++-v3/include/experimental/bits/simd_detail.h b/libstdc++-v3/include/experimental/bits/simd_detail.h index 1e75812d098..ecd059610cd 100644 --- a/libstdc++-v3/include/experimental/bits/simd_detail.h +++ b/libstdc++-v3/include/experimental/bits/simd_detail.h @@ -30,6 +30,7 @@ #include #include +/// @cond undocumented #define _GLIBCXX_SIMD_BEGIN_NAMESPACE \ namespace std _GLIBCXX_VISIBILITY(default) \ @@ -300,6 +301,8 @@ #define _GLIBCXX_SIMD_FIX_P2TS_ISSUE66 1 // }}} +/// @endcond + #endif // __cplusplus >= 201703L #endif // _GLIBCXX_EXPERIMENTAL_SIMD_DETAIL_H_ diff --git a/libstdc++-v3/include/experimental/simd b/libstdc++-v3/include/experimental/simd index beccbc14fa5..6f867a9d52d 100644 --- a/libstdc++-v3/include/experimental/simd +++ b/libstdc++-v3/include/experimental/simd @@ -35,6 +35,23 @@ #if __cplusplus >= 201703L +/** @defgroup par-ts Parallelism TS + * @ingroup experimental + * + * Components defined by the _C++ Extensions for Parallelism_ + * Technical Specification. + * + * - ISO/IEC TS 19570:2015 C++ Extensions for Parallelism + * - ISO/IEC TS 19570:2018 C++ Extensions for Parallelism, Version 2 + */ + +/** @defgroup ts_simd Data parallel extensions + * @ingroup par-ts + * + * Data-parallel types library. + * @since C++17 + */ +/// @ingroup ts_simd #define __cpp_lib_experimental_parallel_simd 201803 #pragma GCC diagnostic push diff --git a/libstdc++-v3/include/experimental/type_traits b/libstdc++-v3/include/experimental/type_traits index 39ada113463..b90641905ce 100644 --- a/libstdc++-v3/include/experimental/type_traits +++ b/libstdc++-v3/include/experimental/type_traits @@ -24,7 +24,14 @@ /** @file experimental/type_traits * This is a TS C++ Library header. + * + * This header defines variable templates for the C++14 type traits. + * + * Equivalent variable templates are defined in namespace `std` since C++17. + * @see variable_templates + * * @ingroup libfund-ts + * @since C++14 */ // @@ -49,6 +56,14 @@ namespace experimental { inline namespace fundamentals_v1 { +/** @defgroup lfts_variable_templates Variable template for type traits + * @ingroup libfund-ts + * @since Library Fundamentals TS v1. C++14. + * @see variable_templates + */ +/** @ingroup lfts_variable_templates + * @{ + */ #define __cpp_lib_experimental_type_trait_variable_templates 201402 // See C++14 20.10.4.1, primary type categories @@ -213,7 +228,7 @@ template constexpr bool is_base_of_v = is_base_of<_Base, _Derived>::value; template constexpr bool is_convertible_v = is_convertible<_From, _To>::value; - +/// @} // 3.3.2, Other type transformations // invocation_type (still unimplemented) @@ -224,14 +239,24 @@ template inline namespace fundamentals_v2 { +/** + * @defgroup lfts_detect Detection idiom + * @ingroup libfund-ts + * @since Library Fundamentals TS v2. C++14. + */ +/** @ingroup lfts_detect + * @{ + */ #define __cpp_lib_experimental_detect 201505 // [meta.detect] +/// A metafunction that always yields void, used for detecting valid types. template using void_t = void; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wctor-dtor-privacy" +/// @internal struct __nonesuchbase {}; struct nonesuch : private __nonesuchbase { @@ -272,7 +297,16 @@ template class _Op, typename... _Args> template class _Op, typename... _Args> constexpr bool is_detected_convertible_v = is_detected_convertible<_To, _Op, _Args...>::value; +/// @} +/** + * @defgroup lfts_logical Logical operator traits + * @ingroup libfund-ts + * @since Library Fundamentals TS v2. C++14. + */ +/** @ingroup lfts_logical + * @{ + */ #define __cpp_lib_experimental_logical_traits 201511 template @@ -301,6 +335,7 @@ template template constexpr bool negation_v = negation<_Pp>::value; +/// @} } // namespace fundamentals_v2 } // namespace experimental diff --git a/libstdc++-v3/include/std/scoped_allocator b/libstdc++-v3/include/std/scoped_allocator index 2d2bd72c4a6..34a9c800f45 100644 --- a/libstdc++-v3/include/std/scoped_allocator +++ b/libstdc++-v3/include/std/scoped_allocator @@ -53,6 +53,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * @{ */ + template + class scoped_allocator_adaptor; + /// @cond undocumented template @@ -81,15 +84,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __base::_S_outermost(__a.outer_allocator()); } }; - /// Implementation of the OUTERMOST pseudofunction + // Implementation of the OUTERMOST pseudofunction template inline typename __outermost_type<_Alloc>::type& __outermost(_Alloc& __a) { return __outermost_type<_Alloc>::_S_outermost(__a); } - template - class scoped_allocator_adaptor; - template struct __inner_type_impl; diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index d9068a06f08..cccc6eed763 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -41,6 +41,12 @@ namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION + template + class tuple; + + template + class reference_wrapper; + /** * @defgroup metaprogramming Metaprogramming * @ingroup utilities @@ -49,6 +55,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * including type classification traits, type property inspection traits * and type transformation traits. * + * @since C++11 + * * @{ */ @@ -72,25 +80,31 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION constexpr _Tp integral_constant<_Tp, __v>::value; /// The type used as a compile-time boolean with true value. - typedef integral_constant true_type; + using true_type = integral_constant; /// The type used as a compile-time boolean with false value. - typedef integral_constant false_type; + using false_type = integral_constant; + /// @cond undocumented + /// bool_constant for C++11 template using __bool_constant = integral_constant; + /// @endcond -#if __cplusplus > 201402L +#if __cplusplus >= 201703L # define __cpp_lib_bool_constant 201505 + /// Alias template for compile-time boolean constant types. + /// @since C++17 template using bool_constant = integral_constant; #endif - // Meta programming helper types. + // Metaprogramming helper types. template struct conditional; + /// @cond undocumented template struct __type_identity { using type = _Type; }; @@ -148,13 +162,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct __not_ : public __bool_constant { }; + /// @endcond #if __cplusplus >= 201703L + /// @cond undocumented template inline constexpr bool __or_v = __or_<_Bn...>::value; template inline constexpr bool __and_v = __and_<_Bn...>::value; + /// @endcond #define __cpp_lib_logical_traits 201510 @@ -173,6 +190,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION : __not_<_Pp> { }; + /** @ingroup variable_templates + * @{ + */ template inline constexpr bool conjunction_v = conjunction<_Bn...>::value; @@ -181,6 +201,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template inline constexpr bool negation_v = negation<_Pp>::value; + /// @} #endif // C++17 @@ -191,6 +212,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct is_function; template struct is_void; + template + struct remove_cv; + template + struct is_const; + + /// @cond undocumented template struct __is_array_unknown_bounds; @@ -223,16 +250,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct __failure_type { }; - template - struct remove_cv; - // __remove_cv_t (std::remove_cv_t for C++11). template using __remove_cv_t = typename remove_cv<_Tp>::type; - template - struct is_const; - // Primary type categories. template @@ -242,6 +263,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<> struct __is_void_helper : public true_type { }; + /// @endcond /// is_void template @@ -249,6 +271,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION : public __is_void_helper<__remove_cv_t<_Tp>>::type { }; + /// @cond undocumented template struct __is_integral_helper : public false_type { }; @@ -362,6 +385,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct __is_integral_helper : public true_type { }; #endif + /// @endcond /// is_integral template @@ -369,6 +393,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION : public __is_integral_helper<__remove_cv_t<_Tp>>::type { }; + /// @cond undocumented template struct __is_floating_point_helper : public false_type { }; @@ -390,6 +415,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct __is_floating_point_helper<__float128> : public true_type { }; #endif + /// @endcond /// is_floating_point template @@ -518,6 +544,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { }; /// __is_nullptr_t (deprecated extension). + /// @deprecated Use `is_null_pointer` instead. template struct __is_nullptr_t : public is_null_pointer<_Tp> @@ -567,6 +594,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct is_compound : public __not_>::type { }; + /// @cond undocumented template struct __is_member_pointer_helper : public false_type { }; @@ -574,6 +602,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template struct __is_member_pointer_helper<_Tp _Cp::*> : public true_type { }; + /// @endcond /// is_member_pointer template @@ -584,6 +613,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template struct is_same; + /// @cond undocumented template using __is_one_of = __or_...>; @@ -644,6 +674,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct __is_referenceable<_Tp, __void_t<_Tp&>> : public true_type { }; + /// @endcond // Type properties. @@ -674,7 +705,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION "template argument must be a complete class or an unbounded array"); }; - // is_trivially_copyable + /// is_trivially_copyable template struct is_trivially_copyable : public integral_constant @@ -692,7 +723,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION "template argument must be a complete class or an unbounded array"); }; - /// is_pod (deprecated in C++20) + /** is_pod (deprecated in C++20) + * @deprecated Use `is_standard_layout && is_trivial` instead. + */ // Could use is_standard_layout && is_trivial instead of the builtin. template struct @@ -704,7 +737,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION "template argument must be a complete class or an unbounded array"); }; - /// is_literal_type + /** is_literal_type + * @deprecated Deprecated in C++20. The idea of a literal type isn't useful. + */ template struct _GLIBCXX17_DEPRECATED @@ -730,6 +765,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #if __cplusplus >= 201402L #define __cpp_lib_is_final 201402L /// is_final + /// @since C++14 template struct is_final : public integral_constant @@ -742,6 +778,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION : public integral_constant { }; + /// @cond undocumented template::value> struct __is_signed_helper @@ -751,6 +788,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct __is_signed_helper<_Tp, true> : public integral_constant { }; + /// @endcond /// is_signed template @@ -764,14 +802,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION : public __and_, __not_>> { }; - - // Destructible and constructible type properties. - - /** - * @brief Utility to simplify expressions used in unevaluated operands - * @ingroup utilities - */ - + /// @cond undocumented template _Up __declval(int); @@ -779,6 +810,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template _Tp __declval(long); + /// @endcond template auto declval() noexcept -> decltype(__declval<_Tp>(0)); @@ -789,6 +821,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template struct remove_all_extents; + /// @cond undocumented template struct __is_array_known_bounds : public integral_constant::value > 0)> @@ -799,6 +832,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION : public __and_, __not_>> { }; + // Destructible and constructible type properties. + // In N3290 is_destructible does not say anything about function // types and abstract types, see LWG 2049. This implementation // describes function types as non-destructible and all complete @@ -840,6 +875,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template struct __is_destructible_safe<_Tp, false, true> : public true_type { }; + /// @endcond /// is_destructible template @@ -850,6 +886,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION "template argument must be a complete class or an unbounded array"); }; + /// @cond undocumented + // is_nothrow_destructible requires that is_destructible is // satisfied as well. We realize that by mimicing the // implementation of is_destructible but refer to noexcept(expr) @@ -891,6 +929,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template struct __is_nt_destructible_safe<_Tp, false, true> : public true_type { }; + /// @endcond /// is_nothrow_destructible template @@ -901,10 +940,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION "template argument must be a complete class or an unbounded array"); }; + /// @cond undocumented template struct __is_constructible_impl : public __bool_constant<__is_constructible(_Tp, _Args...)> { }; + /// @endcond /// is_constructible template @@ -924,6 +965,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION "template argument must be a complete class or an unbounded array"); }; + /// @cond undocumented template::value> struct __is_copy_constructible_impl; @@ -935,6 +977,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct __is_copy_constructible_impl<_Tp, true> : public __is_constructible_impl<_Tp, const _Tp&> { }; + /// @endcond /// is_copy_constructible template @@ -945,6 +988,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION "template argument must be a complete class or an unbounded array"); }; + /// @cond undocumented template::value> struct __is_move_constructible_impl; @@ -956,6 +1000,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct __is_move_constructible_impl<_Tp, true> : public __is_constructible_impl<_Tp, _Tp&&> { }; + /// @endcond /// is_move_constructible template @@ -966,9 +1011,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION "template argument must be a complete class or an unbounded array"); }; + /// @cond undocumented template using __is_nothrow_constructible_impl = __bool_constant<__is_nothrow_constructible(_Tp, _Args...)>; + /// @endcond /// is_nothrow_constructible template @@ -988,7 +1035,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION "template argument must be a complete class or an unbounded array"); }; - + /// @cond undocumented template::value> struct __is_nothrow_copy_constructible_impl; @@ -1000,6 +1047,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct __is_nothrow_copy_constructible_impl<_Tp, true> : public __is_nothrow_constructible_impl<_Tp, const _Tp&> { }; + /// @endcond /// is_nothrow_copy_constructible template @@ -1010,6 +1058,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION "template argument must be a complete class or an unbounded array"); }; + /// @cond undocumented template::value> struct __is_nothrow_move_constructible_impl; @@ -1021,6 +1070,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct __is_nothrow_move_constructible_impl<_Tp, true> : public __is_nothrow_constructible_impl<_Tp, _Tp&&> { }; + /// @endcond /// is_nothrow_move_constructible template @@ -1605,6 +1655,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // Sign modifications. + /// @cond undocumented + // Utility for constructing identically cv-qualified types. template struct __cv_selector; @@ -1776,6 +1828,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION using __type = typename __make_unsigned_selector::__type; }; + /// @endcond // Given an integral/enum type, return the corresponding unsigned // integer type. @@ -1789,6 +1842,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<> struct make_unsigned; + /// @cond undocumented // Utility for finding the signed versions of unsigned integral types. template @@ -1902,6 +1956,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION using __type = typename __make_signed_selector::__type; }; + /// @endcond // Given an integral/enum type, return the corresponding signed // integer type. @@ -1979,7 +2034,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION : public __remove_pointer_helper<_Tp, __remove_cv_t<_Tp>> { }; - /// add_pointer template, is_void<_Tp>>::value> struct __add_pointer_helper @@ -1989,6 +2043,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct __add_pointer_helper<_Tp, true> { typedef typename remove_reference<_Tp>::type* type; }; + /// add_pointer template struct add_pointer : public __add_pointer_helper<_Tp> @@ -2082,6 +2137,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template const size_t aligned_union<_Len, _Types...>::alignment_value; + /// @cond undocumented + // Decay trait for arrays and functions, used for perfect forwarding // in make_pair, make_tuple, etc. template struct __decay_selector<_Up, false, true> { typedef typename add_pointer<_Up>::type __type; }; + /// @endcond /// decay template @@ -2112,12 +2170,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef typename __decay_selector<__remove_type>::__type type; }; - // __decay_t (std::decay_t for C++11). - template - using __decay_t = typename decay<_Tp>::type; - - template - class reference_wrapper; + /// @cond undocumented // Helper which adds a reference to a type when given a reference_wrapper template @@ -2132,12 +2185,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef _Tp& __type; }; + // __decay_t (std::decay_t for C++11). template - using __decay_and_strip = __strip_reference_wrapper<__decay_t<_Tp>>; + using __decay_t = typename decay<_Tp>::type; + template + using __decay_and_strip = __strip_reference_wrapper<__decay_t<_Tp>>; + /// @endcond // Primary template. - /// Define a member typedef @c type only if a boolean constant is true. + /// Define a member typedef `type` only if a boolean constant is true. template struct enable_if { }; @@ -2147,13 +2204,22 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct enable_if { typedef _Tp type; }; + /// @cond undocumented + // __enable_if_t (std::enable_if_t for C++11) template using __enable_if_t = typename enable_if<_Cond, _Tp>::type; + // Helper for SFINAE constraints template using _Require = __enable_if_t<__and_<_Cond...>::value>; + // __remove_cvref_t (std::remove_cvref_t for C++11). + template + using __remove_cvref_t + = typename remove_cv::type>::type; + /// @endcond + // Primary template. /// Define a member typedef @c type to one of two argument types. template @@ -2165,17 +2231,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct conditional { typedef _Iffalse type; }; - // __remove_cvref_t (std::remove_cvref_t for C++11). - template - using __remove_cvref_t - = typename remove_cv::type>::type; - /// common_type template struct common_type; // Sfinae-friendly common_type implementation: + /// @cond undocumented struct __do_common_type_impl { template @@ -2278,6 +2340,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template struct __underlying_type_impl<_Tp, false> { }; + /// @endcond /// The underlying type of an enum. template @@ -2285,12 +2348,18 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION : public __underlying_type_impl<_Tp> { }; + /// @cond undocumented template struct __declval_protector { static const bool __stop = false; }; + /// @endcond + /** Utility to simplify expressions used in unevaluated operands + * @since C++11 + * @ingroup utilities + */ template auto declval() noexcept -> decltype(__declval<_Tp>(0)) { @@ -2307,6 +2376,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #define __cpp_lib_result_of_sfinae 201210 + /// @cond undocumented struct __invoke_memfun_ref { }; struct __invoke_memfun_deref { }; struct __invoke_memobj_ref { }; @@ -2490,6 +2560,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _Functor, _ArgTypes... >::type { }; + /// @endcond template struct result_of<_Functor(_ArgTypes...)> @@ -2536,6 +2607,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template using void_t = void; #endif + /// @cond undocumented + /// Implementation of the detection idiom (negative case). template class _Op, typename... _Args> @@ -2565,8 +2638,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION using __detected_or_t = typename __detected_or<_Default, _Op, _Args...>::type; - /// @} group metaprogramming - /** * Use SFINAE to determine if the type _Tp has a publicly-accessible * member type _NTYPE. @@ -2587,9 +2658,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template struct __is_nothrow_swappable; - template - class tuple; - template struct __is_tuple_like_impl : false_type { }; @@ -2603,6 +2671,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct __is_tuple_like : public __is_tuple_like_impl<__remove_cvref_t<_Tp>>::type { }; + /// @endcond template _GLIBCXX20_CONSTEXPR @@ -2621,6 +2690,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm]) noexcept(__is_nothrow_swappable<_Tp>::value); + /// @cond undocumented namespace __swappable_details { using std::swap; @@ -2670,6 +2740,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct __is_nothrow_swappable : public __is_nothrow_swappable_impl<_Tp>::type { }; + /// @endcond #if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11 #define __cpp_lib_is_swappable 201603 @@ -2705,6 +2776,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION is_nothrow_swappable<_Tp>::value; #endif // __cplusplus >= 201402L + /// @cond undocumented namespace __swappable_with_details { using std::swap; @@ -2764,6 +2836,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { typedef decltype(__test<_Tp&>(0)) type; }; + /// @endcond /// is_swappable_with template @@ -2801,6 +2874,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #endif// c++1z or gnu++11 + /// @cond undocumented + // __is_invocable (std::is_invocable for C++11) // The primary template is used for invalid INVOKE expressions. @@ -2912,6 +2987,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION void operator=(__nonesuch const&) = delete; }; #pragma GCC diagnostic pop + /// @endcond #if __cplusplus >= 201703L # define __cpp_lib_is_invocable 201703 @@ -2971,6 +3047,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION "each argument type must be a complete class or an unbounded array"); }; + /// @cond undocumented template struct __is_nt_invocable_impl : false_type { }; @@ -2980,6 +3057,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION : __or_, __is_nothrow_convertible> { }; + /// @endcond /// std::is_nothrow_invocable_r template @@ -2995,29 +3073,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION static_assert(std::__is_complete_or_unbounded(__type_identity<_Ret>{}), "_Ret must be a complete class or an unbounded array"); }; - - /// std::is_invocable_v - template - inline constexpr bool is_invocable_v = is_invocable<_Fn, _Args...>::value; - - /// std::is_nothrow_invocable_v - template - inline constexpr bool is_nothrow_invocable_v - = is_nothrow_invocable<_Fn, _Args...>::value; - - /// std::is_invocable_r_v - template - inline constexpr bool is_invocable_r_v - = is_invocable_r<_Ret, _Fn, _Args...>::value; - - /// std::is_nothrow_invocable_r_v - template - inline constexpr bool is_nothrow_invocable_r_v - = is_nothrow_invocable_r<_Ret, _Fn, _Args...>::value; #endif // C++17 #if __cplusplus >= 201703L # define __cpp_lib_type_trait_variable_templates 201510L + /** + * @defgroup variable_templates Variable templates for type traits. + * @ingroup metaprogramming + * + * The variable `is_foo_v` is a boolean constant with the same value + * as the type trait `is_foo::value`. + * + * @since C++17 + */ + + /** @ingroup variable_templates + * @{ + */ template inline constexpr bool is_void_v = is_void<_Tp>::value; template @@ -3184,6 +3256,18 @@ template inline constexpr bool is_base_of_v = is_base_of<_Base, _Derived>::value; template inline constexpr bool is_convertible_v = is_convertible<_From, _To>::value; +template + inline constexpr bool is_invocable_v = is_invocable<_Fn, _Args...>::value; +template + inline constexpr bool is_nothrow_invocable_v + = is_nothrow_invocable<_Fn, _Args...>::value; +template + inline constexpr bool is_invocable_r_v + = is_invocable_r<_Ret, _Fn, _Args...>::value; +template + inline constexpr bool is_nothrow_invocable_r_v + = is_nothrow_invocable_r<_Ret, _Fn, _Args...>::value; +/// @} #ifdef _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP # define __cpp_lib_has_unique_object_representations 201606 @@ -3198,6 +3282,7 @@ template "template argument must be a complete class or an unbounded array"); }; + /// @ingroup variable_templates template inline constexpr bool has_unique_object_representations_v = has_unique_object_representations<_Tp>::value; @@ -3211,7 +3296,7 @@ template : bool_constant<__is_aggregate(remove_cv_t<_Tp>)> { }; - /// is_aggregate_v + /// @ingroup variable_templates template inline constexpr bool is_aggregate_v = is_aggregate<_Tp>::value; #endif @@ -3280,10 +3365,12 @@ template : public __is_array_unknown_bounds<_Tp> { }; + /// @ingroup variable_templates template inline constexpr bool is_bounded_array_v = is_bounded_array<_Tp>::value; + /// @ingroup variable_templates template inline constexpr bool is_unbounded_array_v = is_unbounded_array<_Tp>::value; @@ -3291,6 +3378,9 @@ template #if __cplusplus > 202002L #define __cpp_lib_is_scoped_enum 202011L + /// @since C++23 + //@{ + template struct is_scoped_enum : false_type @@ -3312,6 +3402,9 @@ template : bool_constant { }; + /** + * @ingroup variable_templates + */ template inline constexpr bool is_scoped_enum_v = is_scoped_enum<_Tp>::value; #endif // C++23 @@ -3320,11 +3413,14 @@ template #define __cpp_lib_is_constant_evaluated 201811L + /// Returns true only when called during constant evaluation. constexpr inline bool is_constant_evaluated() noexcept { return __builtin_is_constant_evaluated(); } + /// @} #endif + /// @cond undocumented template using __copy_cv = typename __match_cv_qualifiers<_From, _To>::__type; @@ -3378,12 +3474,14 @@ template struct __common_ref_impl<_Xp&, _Yp&&> : __common_ref_impl<_Yp&&, _Xp&> { }; + /// @endcond template class _TQual, template class _UQual> struct basic_common_reference { }; + /// @cond undocumented template struct __xref { template using __type = __copy_cv<_Tp, _Up>; }; @@ -3402,6 +3500,7 @@ template remove_cvref_t<_Tp2>, __xref<_Tp1>::template __type, __xref<_Tp2>::template __type>::type; + /// @endcond template struct common_reference; @@ -3419,6 +3518,7 @@ template struct common_reference<_Tp0> { using type = _Tp0; }; + /// @cond undocumented template struct __common_reference_impl : __common_reference_impl<_Tp1, _Tp2, _Bullet + 1> @@ -3488,9 +3588,12 @@ template void_t>> : public common_reference, _Rest...> { }; + /// @endcond #endif // C++2a + /// @} group metaprogramming + _GLIBCXX_END_NAMESPACE_VERSION } // namespace std diff --git a/libstdc++-v3/include/std/variant b/libstdc++-v3/include/std/variant index 9b2bc440841..a4e038e0ec8 100644 --- a/libstdc++-v3/include/std/variant +++ b/libstdc++-v3/include/std/variant @@ -1723,6 +1723,7 @@ namespace __variant return __detail::__variant::__get<_Np>(std::move(__v)); } + /// @cond undocumented template constexpr decltype(auto) __do_visit(_Visitor&& __visitor, _Variants&&... __variants) @@ -1734,6 +1735,7 @@ namespace __variant return (*__func_ptr)(std::forward<_Visitor>(__visitor), std::forward<_Variants>(__variants)...); } + /// @endcond template constexpr __detail::__variant::__visit_result_t<_Visitor, _Variants...> @@ -1784,6 +1786,7 @@ namespace __variant } #endif + /// @cond undocumented template struct __variant_hash_call_base_impl { @@ -1814,6 +1817,7 @@ namespace __variant using __variant_hash_call_base = __variant_hash_call_base_impl<(__poison_hash>:: __enable_hash_call &&...), _Types...>; + /// @endcond template struct hash> diff --git a/libstdc++-v3/testsuite/26_numerics/random/pr60037-neg.cc b/libstdc++-v3/testsuite/26_numerics/random/pr60037-neg.cc index ba252ef34fe..1da46ceebda 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/pr60037-neg.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/pr60037-neg.cc @@ -10,6 +10,6 @@ std::__detail::_Adaptor aurng(urng); auto x = std::generate_canonical::digits>(urng); -// { dg-error "static assertion failed: template argument must be a floating point type" "" { target *-*-* } 167 } +// { dg-error "static assertion failed: template argument must be a floating point type" "" { target *-*-* } 166 } // { dg-error "static assertion failed: template argument must be a floating point type" "" { target *-*-* } 3346 }