]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Remove Doxygen @return on void functions
authorJonathan Wakely <jwakely@redhat.com>
Wed, 1 Apr 2026 14:06:21 +0000 (15:06 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 2 Apr 2026 12:59:56 +0000 (13:59 +0100)
With the latest version of Doxygen this gives a warning about using
@return on a function that returns void. Stating it explicitly adds very
little value, anybody can see from the signature that a function returns
void.

libstdc++-v3/ChangeLog:

* include/bits/move.h (swap): Remove @return from Doxygen
comment.
* include/bits/stl_algo.h (inplace_merge, shuffle)
(random_shuffle, partial_sort, nth_element, sort)
(stable_sort): Likewise.
* include/bits/stl_algobase.h (iter_swap, fill): Likewise.
* include/bits/stl_deque.h (_Deque_base::_M_initialize_map)
(deque::_M_range_initialize, deque::_M_fill_initialize):
Likewise.
* include/bits/stl_iterator_base_funcs.h (advance): Likewise.
* include/bits/stl_numeric.h (iota): Likewise.
* include/bits/stl_tempbuf.h (return_temporary_buffer):
Likewise.
* include/bits/stl_uninitialized.h (uninitialized_fill):
Likewise.

Reviewed-by: Tomasz KamiƄski <tkaminsk@redhat.com>
libstdc++-v3/include/bits/move.h
libstdc++-v3/include/bits/stl_algo.h
libstdc++-v3/include/bits/stl_algobase.h
libstdc++-v3/include/bits/stl_deque.h
libstdc++-v3/include/bits/stl_iterator_base_funcs.h
libstdc++-v3/include/bits/stl_numeric.h
libstdc++-v3/include/bits/stl_tempbuf.h
libstdc++-v3/include/bits/stl_uninitialized.h

index 34962455129e06f08a73d840c60137f7ca7d6fe2..1a03db661123638e4c59955519e52cc3385e92b1 100644 (file)
@@ -212,7 +212,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    *  @brief Swaps two values.
    *  @param  __a  A thing of arbitrary type.
    *  @param  __b  Another thing of arbitrary type.
-   *  @return   Nothing.
   */
   template<typename _Tp>
 #if __glibcxx_concepts // >= C++20
index aa62bff8a469608e7a0c9c52b176123008305a1c..adf9b9e0f2808f748bfb30a98375ea5cb7f3cc44 100644 (file)
@@ -2531,7 +2531,6 @@ _GLIBCXX_END_INLINE_ABI_NAMESPACE(_V2)
    *  @param  __first   An iterator.
    *  @param  __middle  Another iterator.
    *  @param  __last    Another iterator.
-   *  @return  Nothing.
    *
    *  Merges two sorted and consecutive ranges, [__first,__middle) and
    *  [__middle,__last), and puts the result in [__first,__last).  The
@@ -2570,7 +2569,6 @@ _GLIBCXX_END_INLINE_ABI_NAMESPACE(_V2)
    *  @param  __middle  Another iterator.
    *  @param  __last    Another iterator.
    *  @param  __comp    A functor to use for comparisons.
-   *  @return  Nothing.
    *
    *  Merges two sorted and consecutive ranges, [__first,__middle) and
    *  [middle,last), and puts the result in [__first,__last).  The output will
@@ -3678,7 +3676,6 @@ _GLIBCXX_END_INLINE_ABI_NAMESPACE(_V2)
    *  @param  __first   A forward iterator.
    *  @param  __last    A forward iterator.
    *  @param  __g       A UniformRandomNumberGenerator (26.5.1.3).
-   *  @return  Nothing.
    *
    *  Reorders the elements in the range @p [__first,__last) using @p __g to
    *  provide random numbers.
@@ -4499,7 +4496,6 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
    *  @ingroup mutating_algorithms
    *  @param  __first   A forward iterator.
    *  @param  __last    A forward iterator.
-   *  @return  Nothing.
    *
    *  Reorder the elements in the range `[__first, __last)` using a random
    *  distribution, so that every possible ordering of the sequence is
@@ -4565,7 +4561,6 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
    *  @param  __first   A forward iterator.
    *  @param  __last    A forward iterator.
    *  @param  __rand    The RNG functor or function.
-   *  @return  Nothing.
    *
    *  Reorders the elements in the range `[__first, __last)` using `__rand`
    *  to provide a random distribution. Calling `__rand(N)` for a positive
@@ -4647,7 +4642,6 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
    *  @param  __first   An iterator.
    *  @param  __middle  Another iterator.
    *  @param  __last    Another iterator.
-   *  @return  Nothing.
    *
    *  Sorts the smallest `(__middle - __first)` elements in the range
    *  `[first, last)` and moves them to the range `[__first, __middle)`. The
@@ -4686,7 +4680,6 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
    *  @param  __middle  Another iterator.
    *  @param  __last    Another iterator.
    *  @param  __comp    A comparison functor.
-   *  @return  Nothing.
    *
    *  Sorts the smallest `(__middle - __first)` elements in the range
    *  `[__first, __last)` and moves them to the range `[__first, __middle)`.
@@ -4724,7 +4717,6 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
    *  @param  __first   An iterator.
    *  @param  __nth     Another iterator.
    *  @param  __last    Another iterator.
-   *  @return  Nothing.
    *
    *  Rearranges the elements in the range `[__first, __last)` so that `*__nth`
    *  is the same element that would have been in that position had the
@@ -4764,7 +4756,6 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
    *  @param  __nth     Another iterator.
    *  @param  __last    Another iterator.
    *  @param  __comp    A comparison functor.
-   *  @return  Nothing.
    *
    *  Rearranges the elements in the range `[__first, __last)` so that `*__nth`
    *  is the same element that would have been in that position had the
@@ -4802,7 +4793,6 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
    *  @ingroup sorting_algorithms
    *  @param  __first   An iterator.
    *  @param  __last    Another iterator.
-   *  @return  Nothing.
    *
    *  Sorts the elements in the range `[__first, __last)` in ascending order,
    *  such that for each iterator `i` in the range `[__first, __last - 1)`,
@@ -4833,7 +4823,6 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
    *  @param  __first   An iterator.
    *  @param  __last    Another iterator.
    *  @param  __comp    A comparison functor.
-   *  @return  Nothing.
    *
    *  Sorts the elements in the range `[__first, __last)` in ascending order,
    *  such that `__comp(*(i+1), *i)` is false for every iterator `i` in the
@@ -5028,7 +5017,6 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
    *  @ingroup sorting_algorithms
    *  @param  __first   An iterator.
    *  @param  __last    Another iterator.
-   *  @return  Nothing.
    *
    *  Sorts the elements in the range @p [__first,__last) in ascending order,
    *  such that for each iterator @p i in the range @p [__first,__last-1),
@@ -5063,7 +5051,6 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
    *  @param  __first   An iterator.
    *  @param  __last    Another iterator.
    *  @param  __comp    A comparison functor.
-   *  @return  Nothing.
    *
    *  Sorts the elements in the range @p [__first,__last) in ascending order,
    *  such that for each iterator @p i in the range @p [__first,__last-1),
index 3fdbff97353856f1e9b033a21ba32fb481abf823..1350736a8d8e7525ac20b2f91591e912f1769c0a 100644 (file)
@@ -144,7 +144,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    *  @ingroup mutating_algorithms
    *  @param  __a  An iterator.
    *  @param  __b  Another iterator.
-   *  @return   Nothing.
    *
    *  This function swaps the values pointed to by two iterators, not the
    *  iterators themselves.
@@ -990,7 +989,6 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
    *  @param  __first  A forward iterator.
    *  @param  __last   A forward iterator.
    *  @param  __value  A reference-to-const of arbitrary type.
-   *  @return   Nothing.
    *
    *  This function fills a range with copies of the same value.  For char
    *  types filling contiguous areas of memory, this becomes an inline call
index c08212861b6ce690f455a445ecfb4e9632a771c3..aebe865ffc1adc589e06ba529260499a0aa1953d 100644 (file)
@@ -632,7 +632,6 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
    *  @brief Layout storage.
    *  @param  __num_elements  The count of T's for which to allocate space
    *                          at first.
-   *  @return   Nothing.
    *
    *  The initial underlying memory layout is a bit complicated...
   */
@@ -1985,7 +1984,6 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
        *  @brief Fills the deque with whatever is in [first,last).
        *  @param  __first  An input iterator.
        *  @param  __last  An input iterator.
-       *  @return   Nothing.
        *
        *  If the iterators are actually forward iterators (or better), then the
        *  memory layout can be done all at once.  Else we move forward using
@@ -2006,7 +2004,6 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       /**
        *  @brief Fills the %deque with copies of value.
        *  @param  __value  Initial value.
-       *  @return   Nothing.
        *  @pre _M_start and _M_finish have already been initialized,
        *  but none of the %deque's elements have yet been constructed.
        *
index 515d6e6c04f88dc45c7dff2c6290f9aa604c8f7f..d85b393654007f39b13f2a8c78c11f11704b249a 100644 (file)
@@ -248,7 +248,6 @@ namespace __detail
    *  @brief A generalization of pointer arithmetic.
    *  @param  __i  An input iterator.
    *  @param  __n  The @a delta by which to change @p __i.
-   *  @return  Nothing.
    *
    *  This increments @p i by @p n.  For bidirectional and random access
    *  iterators, @p __n may be negative, in which case @p __i is decremented.
index dad20c806b30d380624ac57e05007d4b9c162711..182769f0dc4f3256a8cbde8cb4c0807ef17713ee 100644 (file)
@@ -79,7 +79,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    *  @param  __first  Start of range.
    *  @param  __last  End of range.
    *  @param  __value  Starting value.
-   *  @return  Nothing.
    *  @ingroup numeric_ops
    */
   template<typename _ForwardIterator, typename _Tp>
index 1ae41991910c73487b3fb88e18face072c0b6118..a1d0a39f0b98a0fae37499a7f57e3906338e9203 100644 (file)
@@ -159,7 +159,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   /**
    *  @brief The companion to get_temporary_buffer().
    *  @param  __p  A buffer previously allocated by get_temporary_buffer.
-   *  @return   None.
    *
    *  Frees the memory pointed to by __p.
    */
index ecc24023e98fc18972a520abb277797f6fc77340..1c1fcfd62a4d85511187eae495d858027da219e3 100644 (file)
@@ -403,7 +403,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    *  @param  __first  A forward iterator.
    *  @param  __last   A forward iterator.
    *  @param  __x      The source value.
-   *  @return   Nothing.
    *
    *  Like std::fill, but does not require an initialized output range.
   */