]> 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>
Thu, 23 Nov 2023 17:44:26 +0000 (17:44 +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.

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

index 70dacb3fdf296bf90736c7c582fe5760ce917ca7..1773b723b66e1d77d9d69cdfaab2e19d1439d38a 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