]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix access error in __gnu_test::uneq_allocator
authorJonathan Wakely <jwakely@redhat.com>
Thu, 23 Nov 2023 14:34:59 +0000 (14:34 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 18 Mar 2024 11:01:26 +0000 (11:01 +0000)
The operator== function is only a friend of the LHS argument, so cannot
access the private member of the RHS argument. Use the public accessor
instead.

libstdc++-v3/ChangeLog:

* testsuite/util/testsuite_allocator.h (uneq_allocator): Fix
equality operator for heterogeneous comparisons.

(cherry picked from commit 0585daf7de0673ade9feca1be66a68178786b48d)

libstdc++-v3/testsuite/util/testsuite_allocator.h

index f33f602d2afae2389ceb714cc2362c2d9a02db3a..0c41181b4a5ced1937e5034cedfebeead3a81e0d 100644 (file)
@@ -418,7 +418,7 @@ namespace __gnu_test
        operator==(const uneq_allocator& a,
                   const uneq_allocator<Tp1,
                   typename AllocTraits::template rebind<Tp1>::other>& b)
-       { return a.personality == b.personality; }
+       { return a.personality == b.get_personality(); }
 
       template<typename Tp1>
        friend inline bool