https://gcc.gnu.org/g:9b3957cd5958955ffae2a5cc7ad3b37e110e8d8f
commit r16-8418-g9b3957cd5958955ffae2a5cc7ad3b37e110e8d8f Author: Jonathan Wakely <[email protected]> Date: Tue Mar 31 16:00:41 2026 +0100 libstdc++: Fix errors in Doxygen markup libstdc++-v3/ChangeLog: * doc/doxygen/doxygroups.cc: Define variable_templates group. * include/bits/binders.h: Fix @file name. * include/bits/formatfwd.h: Add missing @cond * include/bits/forward_list.h: Add closing backtick in comment. * include/bits/out_ptr.h (out_ptr, inout_ptr): Fix names in @param comments. * include/bits/regex_constants.h: Escape backtick in comment. * include/bits/stl_map.h: Add missing @{. * include/bits/stl_set.h: Likewise. * include/bits/stl_pair.h: Move declaration of complex into #if group where it's used. Fix nesting of @cond and @endcond in #if groups. * include/std/functional: Move @cond inside #if group. * include/std/type_traits: Likewise. * libsupc++/exception: Fix typo'd backtick. Reviewed-by: Tomasz KamiĆski <[email protected]> Diff: --- libstdc++-v3/doc/doxygen/doxygroups.cc | 15 +++++++++++++++ libstdc++-v3/include/bits/binders.h | 2 +- libstdc++-v3/include/bits/formatfwd.h | 1 + libstdc++-v3/include/bits/forward_list.h | 2 +- libstdc++-v3/include/bits/out_ptr.h | 4 ++-- libstdc++-v3/include/bits/regex_constants.h | 4 ++-- libstdc++-v3/include/bits/stl_map.h | 1 + libstdc++-v3/include/bits/stl_pair.h | 9 ++++++--- libstdc++-v3/include/bits/stl_set.h | 1 + libstdc++-v3/include/std/functional | 2 +- libstdc++-v3/include/std/type_traits | 8 ++++---- libstdc++-v3/libsupc++/exception | 4 ++-- 12 files changed, 37 insertions(+), 16 deletions(-) diff --git a/libstdc++-v3/doc/doxygen/doxygroups.cc b/libstdc++-v3/doc/doxygen/doxygroups.cc index 27d4a5e20ba9..00d945ceba00 100644 --- a/libstdc++-v3/doc/doxygen/doxygroups.cc +++ b/libstdc++-v3/doc/doxygen/doxygroups.cc @@ -164,6 +164,21 @@ summarized in <a href="tables.html">tables</a>. */ * and condition variables. */ +/** + * @defgroup variable_templates Variable Templates + * @ingroup metaprogramming + * @since C++17 + * + * Each trait in `<type_traits>` that has a `value` static data member is + * also available as a variable template, using the same name with a `_v` + * suffix. For example, `std::is_integral_v<T>` is a `bool` constant with + * the same value as `std::is_integral<T>::value`. + * + * In some cases, using the variable template instead of the `::value` member + * avoids instantiating the class template for the trait. This gives the + * compiler less work to do and can make your code compile a little faster. + */ + /** * @defgroup experimental Technical Specifications * diff --git a/libstdc++-v3/include/bits/binders.h b/libstdc++-v3/include/bits/binders.h index 972471745bd4..51dba4cb446d 100644 --- a/libstdc++-v3/include/bits/binders.h +++ b/libstdc++-v3/include/bits/binders.h @@ -23,7 +23,7 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // <http://www.gnu.org/licenses/>. -/** @file include/bits/binder.h +/** @file include/bits/binders.h * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{functional} */ diff --git a/libstdc++-v3/include/bits/formatfwd.h b/libstdc++-v3/include/bits/formatfwd.h index d2dfb17492d1..d28ca70b7d80 100644 --- a/libstdc++-v3/include/bits/formatfwd.h +++ b/libstdc++-v3/include/bits/formatfwd.h @@ -56,6 +56,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // [format.formatter], formatter template<typename _Tp, typename _CharT = char> struct formatter; +/// @cond undocumented namespace __format { #ifdef _GLIBCXX_USE_WCHAR_T diff --git a/libstdc++-v3/include/bits/forward_list.h b/libstdc++-v3/include/bits/forward_list.h index 025486646f3c..7b333b3b0b6e 100644 --- a/libstdc++-v3/include/bits/forward_list.h +++ b/libstdc++-v3/include/bits/forward_list.h @@ -1461,7 +1461,7 @@ namespace __fwdlist * * This function will insert copies of the data in the range * `[ __first, __last)` into the %forward_list after the - * location specified by `__pos. + * location specified by `__pos`. * * This operation is linear in the number of elements inserted and * does not invalidate iterators and references. diff --git a/libstdc++-v3/include/bits/out_ptr.h b/libstdc++-v3/include/bits/out_ptr.h index 48fe3475b2f7..cc5a8a3adacb 100644 --- a/libstdc++-v3/include/bits/out_ptr.h +++ b/libstdc++-v3/include/bits/out_ptr.h @@ -396,7 +396,7 @@ namespace __detail /** * @tparam _Pointer The type of pointer to convert to. * @param __s The pointer that should take ownership of the result. - * @param __args... Arguments to use when resetting the smart pointer. + * @param __args Pack of arguments to use when resetting the smart pointer. * @return A `std::out_ptr_t` referring to `__s`. * @since C++23 * @headerfile <memory> @@ -417,7 +417,7 @@ namespace __detail /** * @tparam _Pointer The type of pointer to convert to. * @param __s The pointer that should take ownership of the result. - * @param __args... Arguments to use when resetting the smart pointer. + * @param __args Pack of arguments to use when resetting the smart pointer. * @return A `std::inout_ptr_t` referring to `__s`. * @since C++23 * @headerfile <memory> diff --git a/libstdc++-v3/include/bits/regex_constants.h b/libstdc++-v3/include/bits/regex_constants.h index 32b9de1000b2..e18f162196e3 100644 --- a/libstdc++-v3/include/bits/regex_constants.h +++ b/libstdc++-v3/include/bits/regex_constants.h @@ -335,9 +335,9 @@ namespace regex_constants * Format strings (from ECMA-262 [15.5.4.11]): * @li $$ The dollar-sign itself ($) * @li $& The matched substring. - * @li $` The portion of @a string that precedes the matched substring. + * @li $\` The portion of the string that precedes the matched substring. * This would be match_results::prefix(). - * @li $' The portion of @a string that follows the matched substring. + * @li $' The portion of the string that follows the matched substring. * This would be match_results::suffix(). * @li $n The nth capture, where n is in [1,9] and $n is not followed by a * decimal digit. If n <= match_results::size() and the nth capture diff --git a/libstdc++-v3/include/bits/stl_map.h b/libstdc++-v3/include/bits/stl_map.h index 1e119a95b5cd..88a8faab9244 100644 --- a/libstdc++-v3/include/bits/stl_map.h +++ b/libstdc++-v3/include/bits/stl_map.h @@ -1096,6 +1096,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER * is assigned from __obj. * * Insertion requires logarithmic time. + * @{ */ template <typename _Obj> pair<iterator, bool> diff --git a/libstdc++-v3/include/bits/stl_pair.h b/libstdc++-v3/include/bits/stl_pair.h index efe6f72569ba..aa49f87fc137 100644 --- a/libstdc++-v3/include/bits/stl_pair.h +++ b/libstdc++-v3/include/bits/stl_pair.h @@ -101,9 +101,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<size_t...> struct _Index_tuple; - template<typename _Tp> - class complex; - template<size_t _Int, class _Tp1, class _Tp2> constexpr typename tuple_element<_Int, pair<_Tp1, _Tp2>>::type& get(pair<_Tp1, _Tp2>& __in) noexcept; @@ -153,6 +150,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION get(const array<_Tp, _Nm>&&) noexcept; #if __glibcxx_tuple_like >= 202311 // >= C++26 + template<typename _Tp> + class complex; + template<size_t _Int, typename _Tp> constexpr _Tp& get(complex<_Tp>&) noexcept; @@ -233,8 +233,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } }; #endif // lib concepts + /// @endcond #endif // C++11 + /// @cond undocumented + #if __glibcxx_tuple_like // >= C++23 template<typename _Tp> inline constexpr bool __is_tuple_v = false; diff --git a/libstdc++-v3/include/bits/stl_set.h b/libstdc++-v3/include/bits/stl_set.h index 14825cc05acb..ce35e28cde78 100644 --- a/libstdc++-v3/include/bits/stl_set.h +++ b/libstdc++-v3/include/bits/stl_set.h @@ -585,6 +585,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER * to the first is returned. * * Insertion requires logarithmic time (if the hint is not taken). + * @{ */ iterator insert(const_iterator __position, const value_type& __x) diff --git a/libstdc++-v3/include/std/functional b/libstdc++-v3/include/std/functional index 314c0f6ac4a4..91478d3e9fbe 100644 --- a/libstdc++-v3/include/std/functional +++ b/libstdc++-v3/include/std/functional @@ -148,9 +148,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } #endif // __cpp_lib_invoke_r +#if __cplusplus >= 201103L /// @cond undocumented -#if __cplusplus >= 201103L template<typename _MemFunPtr, bool __is_mem_fn = is_member_function_pointer<_MemFunPtr>::value> class _Mem_fn_base diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index a7f881fe9736..bba7a3fd03d2 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -2484,15 +2484,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const size_t aligned_union<_Len, _Types...>::alignment_value; #pragma GCC diagnostic pop - /// @cond undocumented - + // Decay trait for arrays and functions, used for perfect forwarding + // in make_pair, make_tuple, etc. #if _GLIBCXX_USE_BUILTIN_TRAIT(__decay) template<typename _Tp> struct decay { using type = __decay(_Tp); }; #else - // Decay trait for arrays and functions, used for perfect forwarding - // in make_pair, make_tuple, etc. + /// @cond undocumented + template<typename _Up> struct __decay_selector : __conditional_t<is_const<const _Up>::value, // false for functions diff --git a/libstdc++-v3/libsupc++/exception b/libstdc++-v3/libsupc++/exception index 0ae01be25dd5..ab3e06da9f79 100644 --- a/libstdc++-v3/libsupc++/exception +++ b/libstdc++-v3/libsupc++/exception @@ -134,8 +134,8 @@ namespace std _GLIBCXX_VISIBILITY(default) * stack unwinding [15.2]. end note]' * * 2: 'When `uncaught_exception()` is true, throwing an - * %exception can result in a call of 1terminate()` - * (15.5.1).' + * %exception can result in a call of `terminate()` + * (15.5.1). */ _GLIBCXX17_DEPRECATED_SUGGEST("std::uncaught_exceptions()") bool uncaught_exception() _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__));
