https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117962

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #0)
> This fails with -std=c++20 -D_GLIBCXX_DEBUG
> 
> #include <memory>
> #include <vector>
> 
> template<typename T>
> struct Alloc : std::allocator<T>
> {
>   using std::allocator<T>::allocator;
> 
>   constexpr explicit Alloc(int p) : personality(p) { }
> 
>   template<typename U>
>     constexpr Alloc(const Alloc<U>& a) : personality(a.personality) { }
> 
>   using is_always_equal = std::false_type;

The bug went unnoticed until now because the relevant tests do not have the
is_always_equal typedef above. That means they incorrectly inherit
is_always_equal from the std::allocator base, and never use the buggy
constructor.

I am testing a patch to implement https://wg21.link/P2868R3 which caused the
tests to start failing in c++26 mode.

Reply via email to