================
@@ -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) {
+      StorageLocation &Loc =
+          State.Lattice.getOrCreateConstMethodReturnStorageLocation(
+              *RecordLoc, DirectCallee, State.Env, [&](StorageLocation &Loc) {
+                // no-op
----------------
jvoung wrote:

No-op seems okay for this case

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

Reply via email to