[RFA] libstdc++: add std:: to pmr alias templates

Message ID 20261003192614.860163-1-jason@redhat.com
State Committed
Commit f73ad52c42f610dea1027342134d7ba624a291f9
Headers
Series [RFA] libstdc++: add std:: to pmr alias templates |

Commit Message

Jason Merrill Oct. 3, 2026, 7:25 p.m. UTC
  Tested x86_64-pc-linux-gnu, OK for trunk?

-- 8< --

When #including this header after import std per P1811, the alias template
is already in scope, so we can't use the unqualified name to refer to the
template in std.  So use a qualified name.

libstdc++-v3/ChangeLog:

	* include/bits/indirect.h (pmr::indirect): Add std:: qualification.
	(pmr::polymorphic): Likewise.
---
 libstdc++-v3/include/bits/indirect.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


base-commit: 148d5582275a0c3046d6d231079459515910c286
  

Comments

Jonathan Wakely Oct. 3, 2026, 9:52 p.m. UTC | #1
On Sat, 3 Oct 2026, 20:26 Jason Merrill, <jason@redhat.com> wrote:

> Tested x86_64-pc-linux-gnu, OK for trunk?
>

OK, thanks



> -- 8< --
>
> When #including this header after import std per P1811, the alias template
> is already in scope, so we can't use the unqualified name to refer to the
> template in std.  So use a qualified name.
>
> libstdc++-v3/ChangeLog:
>
>         * include/bits/indirect.h (pmr::indirect): Add std:: qualification.
>         (pmr::polymorphic): Likewise.
> ---
>  libstdc++-v3/include/bits/indirect.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libstdc++-v3/include/bits/indirect.h
> b/libstdc++-v3/include/bits/indirect.h
> index cb6e9535a8e..9aff4794f0b 100644
> --- a/libstdc++-v3/include/bits/indirect.h
> +++ b/libstdc++-v3/include/bits/indirect.h
> @@ -62,7 +62,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    namespace pmr
>    {
>      template<typename _Tp>
> -      using indirect = indirect<_Tp, polymorphic_allocator<_Tp>>;
> +      using indirect = std::indirect<_Tp, polymorphic_allocator<_Tp>>;
>    }
>  #endif
>
> @@ -462,7 +462,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    namespace pmr
>    {
>      template<typename _Tp>
> -      using polymorphic = polymorphic<_Tp, polymorphic_allocator<_Tp>>;
> +      using polymorphic = std::polymorphic<_Tp,
> polymorphic_allocator<_Tp>>;
>    }
>
>    // [polymorphic], class template polymorphic
>
> base-commit: 148d5582275a0c3046d6d231079459515910c286
> --
> 2.55.0
>
>
  

Patch

diff --git a/libstdc++-v3/include/bits/indirect.h b/libstdc++-v3/include/bits/indirect.h
index cb6e9535a8e..9aff4794f0b 100644
--- a/libstdc++-v3/include/bits/indirect.h
+++ b/libstdc++-v3/include/bits/indirect.h
@@ -62,7 +62,7 @@  _GLIBCXX_BEGIN_NAMESPACE_VERSION
   namespace pmr
   {
     template<typename _Tp>
-      using indirect = indirect<_Tp, polymorphic_allocator<_Tp>>;
+      using indirect = std::indirect<_Tp, polymorphic_allocator<_Tp>>;
   }
 #endif
 
@@ -462,7 +462,7 @@  _GLIBCXX_BEGIN_NAMESPACE_VERSION
   namespace pmr
   {
     template<typename _Tp>
-      using polymorphic = polymorphic<_Tp, polymorphic_allocator<_Tp>>;
+      using polymorphic = std::polymorphic<_Tp, polymorphic_allocator<_Tp>>;
   }
 
   // [polymorphic], class template polymorphic