From 9cc688041a677260af5c1f627b1f070d8a01e6da Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Sun, 30 Jun 2024 21:27:41 +0200 Subject: [PATCH] AK: Give IntrusiveBinaryHeap template args named types Works around https://gcc.gnu.org/PR70413. Without this, the next commit would cause -Wsubobject-linkage warnings for AK/BinaryHeap.h when used in LibCompress/Huffman.h. We can undo this once we're on GCC 14 everywhere. No behavior change. --- AK/BinaryHeap.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/AK/BinaryHeap.h b/AK/BinaryHeap.h index 37ebf02004d..df31103ad2a 100644 --- a/AK/BinaryHeap.h +++ b/AK/BinaryHeap.h @@ -166,11 +166,15 @@ private: V value; }; - IntrusiveBinaryHeap< - Node, - decltype([](Node const& a, Node const& b) { return a.key < b.key; }), - decltype([](Node&, size_t) {})> - m_heap; + struct NodeComparator { + bool operator()(Node const& a, Node const& b) const { return a.key < b.key; } + }; + + struct NodeIndexSetter { + void operator()(Node&, size_t) const { } + }; + + IntrusiveBinaryHeap m_heap; }; }