https://github.com/jayfoad commented: LGTM but this is not specific to ArrayRef, it is just a special case of const return type: https://clang.llvm.org/extra/clang-tidy/checks/readability/const-return-type.html https://github.com/llvm/llvm-project/pull/138818