[PATCH] libstdc++: Add std:: prefix for forward_iterator_tag

Jonathan Wakely jwakely.gcc@gmail.com
Fri Aug 19 18:48:26 GMT 2022


On Fri, 19 Aug 2022, 20:01 , <whh8b@obs.cr> wrote:

> From: Will Hawkins <whh8b@obs.cr>
>
> libstdc++-v3/ChangeLog:
>
>         * include/bits/basic_string (basic_string(const _CharT*, size_type
> _, const _Alloc&)):
>         Add std:: prefix to forward_iterator_tag.
>

This qualification is not necessary, there is no ADL for that expression,
so name lookup cannot possibly find anything except
std::forward_iterator_tag.

N.B. patches for libstdc++ need to be CC'd to gcc-patches as well as the
libstdc++ list.




---
>  libstdc++-v3/include/bits/basic_string.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libstdc++-v3/include/bits/basic_string.h
> b/libstdc++-v3/include/bits/basic_string.h
> index b04fba95678..e7d7833e002 100644
> --- a/libstdc++-v3/include/bits/basic_string.h
> +++ b/libstdc++-v3/include/bits/basic_string.h
> @@ -639,7 +639,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
>           std::__throw_logic_error(__N("basic_string: "
>                                        "construction from null is not
> valid"));
>         const _CharT* __end = __s + traits_type::length(__s);
> -       _M_construct(__s, __end, forward_iterator_tag());
> +       _M_construct(__s, __end, std::forward_iterator_tag());
>        }
>
>        /**
> --
> 2.34.1
>
>


More information about the Libstdc++ mailing list