From 5daca6c2c4a0536c715c25b07cfa2b2003adac53 Mon Sep 17 00:00:00 2001 From: Yashom Dighe Date: Tue, 22 Sep 2020 02:25:04 +0530 Subject: [PATCH] IntrusiveSortedList.hpp: let operator* return a reference So that clang 12 does not complain: loop variable 'child' is always a copy because the range of type 'List' does not return a reference Co-authored-by: Yashom Dighe --- src/include/containers/IntrusiveSortedList.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/include/containers/IntrusiveSortedList.hpp b/src/include/containers/IntrusiveSortedList.hpp index 1997812a50..374478000c 100644 --- a/src/include/containers/IntrusiveSortedList.hpp +++ b/src/include/containers/IntrusiveSortedList.hpp @@ -133,12 +133,12 @@ public: operator T() const { return node; } operator T &() { return node; } - T operator* () const { return node; } + const T &operator* () const { return node; } Iterator &operator++ () { if (node) { node = node->getSortedSibling(); - }; + } return *this; }