with: class UniquePtrGetterAddRefs { operator void **() { return reinterpret_cast<void **>(&mPtrStorage); } } with clang-format 10.0 $ clang-format-10 foo.cpp class UniquePtrGetterAddRefs { operator void * *() { return reinterpret_cast<void **>(&mPtrStorage); } } I don't think it is what we want!
Similar example: --- class ReturnToGlobal { operator LocalRef<Object>*() { return &objRef; } } --- With! $ clang-format-10 foo.cpp class ReturnToGlobal { operator LocalRef<Object> *() { return &objRef; } } Even with PointerAlignment: Left
@MyDeveloperDay is that something you could help with? thanks
see https://reviews.llvm.org/D78879 The result is the following, is this that more like what is expected? clang-format operator.cpp class UniquePtrGetterAddRefs { operator void **() { return reinterpret_cast<void **>(&mPtrStorage); } } class ReturnToGlobal { operator LocalRef<Object>*() { return &objRef; } }
A fix for this has landed b01dca50085768f1f1a5ad21a685906d48c38816
Sam, are these OK to backport? https://reviews.llvm.org/rGeb85e90350e93a64279139e7eca9ca40c8fbf5eb https://reviews.llvm.org/rGb01dca50085768f1f1a5ad21a685906d48c38816
Yes, both look good! (The second doesn't cover `operator T*&`, but that's obscure enough that we don't need a backport I think)
Merged: baeb500a8ca