Obscure Xcode warning in JUCE code with C++20 enabled

Follow up: after some further consideration, I’ve decided for the time being to add the following methods to my copy of JUCE to silence the warning:

bool operator== (const WeakReference& other) const noexcept { return get() == other.get(); }
bool operator!= (const WeakReference& other) const noexcept { return get() != other.get(); }

Even if I would have liked the idea of adding operator==() = default better (it’s more C++20-y), this solution has a few practical advantages that better suit my current situation:

  1. This code is backwards compatible with C++17 (I have some projects that share the same copy of JUCE, that are not ready to be bumped to C++20 yet)

  2. Looking at the implementation of the other (in)equality operators with raw pointers, I’m confident this is the intended behavior when comparing two WeakReferences.
    I’m not equally confident that the same results are obtained using the = default alternative.
    In the latter case, the implementation is left to the compiler which does it by comparing the instance members, and that means delegating the comparison to the comparison between WeakPointer::SharedRef instances. For now they are ReferenceCountedObjectPtr under the hood, which seem to do the right thing, but who knows what may silently change in the future if I merge some more JUCE code down the line?