================ @@ -580,6 +580,26 @@ void handleConstMemberCall(const CallExpr *CE, return; } + // Cache if the const method returns a reference + if (RecordLoc != nullptr && CE->isGLValue()) { + const FunctionDecl *DirectCallee = CE->getDirectCallee(); + if (DirectCallee == nullptr) + return; + + bool isReference = + DirectCallee->getReturnType().getTypePtr()->isReferenceType(); + if (isReference) { ---------------- jvoung wrote:
Yes, I think it wouldn't be needed. Otherwise, `DirectCallee->getReturnType()->isReferenceType()` is a bit shorter (the operator-> will do getTypePtr) https://github.com/llvm/llvm-project/pull/128437 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits