It seems QList::last and QList::first on Qt6 is a false-positive for Wclazy-detaching-member. We get for this a warning. QStringList list; list << "dummy"; list.last().append("hello"); But it won't call any detaching. inline T& first() { Q_ASSERT(!isEmpty()); return *begin(); } inline const T &first() const noexcept { Q_ASSERT(!isEmpty()); return *begin(); } inline T& last() { Q_ASSERT(!isEmpty()); return *(end()-1); } inline const T &last() const noexcept { Q_ASSERT(!isEmpty()); return *(end()-1); }