================ @@ -555,24 +557,26 @@ void handleConstMemberCall(const CallExpr *CE, LatticeTransferState &State) { // If the const method returns an optional or reference to an optional. if (RecordLoc != nullptr && isSupportedOptionalType(CE->getType())) { - StorageLocation *Loc = + const FunctionDecl *DirectCallee = CE->getDirectCallee(); + if (DirectCallee == nullptr) + return; + StorageLocation &Loc = State.Lattice.getOrCreateConstMethodReturnStorageLocation( - *RecordLoc, CE, State.Env, [&](StorageLocation &Loc) { + *RecordLoc, DirectCallee, CE->getType(), State.Env, ---------------- Xazax-hun wrote:
Here, we do not actually pass the return type of `DirectCallee`. The return type of the callee, and the type of the call expression might differ (I think one of differences is when the function returns a reference type). Thus, this use contradicts the documentation of this function. Update the documentation or the call site. https://github.com/llvm/llvm-project/pull/120249 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits