From c3a12397b065a2c9f28f32562b0e3cf2140c0b80 Mon Sep 17 00:00:00 2001 From: Nawid3333 <102778966+Nawid3333@users.noreply.github.com> Date: Wed, 7 Oct 2026 22:56:44 +0200 Subject: [PATCH] tests: use function pointers in the concurrent backing read pairs (#1163) TestConcurrentBackingReads (7e011fa5) builds its reader pairs with std::pair {TryReadBacking, TryReadSparseBacking}. Class template argument deduction then also considers pair's const T1& / const T2& constructors, which deduce function types, and libstdc++ and libc++ reject a pair member of function type ("data member instantiated with function type"), so virtual_memory_allocation_tests no longer compiles on Linux and macOS. MSVC's library accepts it, which is why Windows still builds. Take the functions' addresses so the pairs hold function pointers. Co-authored-by: Claude Opus 5.5 --- tests/VirtualMemoryAllocationTests.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/VirtualMemoryAllocationTests.cpp b/tests/VirtualMemoryAllocationTests.cpp index 41c0a093..6ff8d20f 100644 --- a/tests/VirtualMemoryAllocationTests.cpp +++ b/tests/VirtualMemoryAllocationTests.cpp @@ -617,9 +617,9 @@ void TestConcurrentBackingReads() { using namespace Libs::LibKernel::Memory; const char* test = "ConcurrentBackingReads"; constexpr uint64_t original = 0x123456789abcdef0ull; - for (const auto& readers: {std::pair {TryReadBacking, TryReadBacking}, - std::pair {TryReadBacking, TryReadSparseBacking}, - std::pair {TryReadSparseBacking, TryReadSparseBacking}}) { + for (const auto& readers: {std::pair {&TryReadBacking, &TryReadBacking}, + std::pair {&TryReadBacking, &TryReadSparseBacking}, + std::pair {&TryReadSparseBacking, &TryReadSparseBacking}}) { const auto base = MapNamedFlexible(test, SceKernelPageSize, SceKernelProtCpuRw, "concurrent_backing_reads"); std::memcpy(reinterpret_cast(base), &original, sizeof(original));