[clang] [Clang][Interp] Fix display of syntactically-invalid note for member function calls (PR #102170)

via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 8 10:28:33 PDT 2024


================
@@ -169,11 +170,32 @@ void InterpFrame::describe(llvm::raw_ostream &OS) const {
       F && (F->isBuiltin() || F->isLambdaStaticInvoker()))
     return;
 
+  const Expr *CallExpr = Caller->getExpr(getRetPC());
   const FunctionDecl *F = getCallee();
-  if (const auto *M = dyn_cast<CXXMethodDecl>(F);
-      M && M->isInstance() && !isa<CXXConstructorDecl>(F)) {
-    print(OS, This, S.getCtx(), S.getCtx().getRecordType(M->getParent()));
-    OS << "->";
+  bool IsMemberCall = isa<CXXMethodDecl>(F) && !isa<CXXConstructorDecl>(F) &&
+                      cast<CXXMethodDecl>(F)->isImplicitObjectMemberFunction();
+  if (getThis().isActive() && IsMemberCall) {
----------------
yronglin wrote:

Done!

https://github.com/llvm/llvm-project/pull/102170


More information about the cfe-commits mailing list