[PATCH] D151720: [clang][ExprConstant] Fix display of syntactically-invalid note for member function calls

Shafik Yaghmour via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 21 20:34:31 PDT 2023


shafik added inline comments.


================
Comment at: clang/lib/AST/ExprConstant.cpp:983
           EnableNewConstInterp(C.getLangOpts().EnableNewConstInterp),
-          BottomFrame(*this, SourceLocation(), nullptr, nullptr, CallRef()),
+          BottomFrame(*this, SourceLocation(), nullptr, nullptr,
+                      /*CallExpr=*/nullptr, CallRef()),
----------------
Let's fix the missing one while here.


================
Comment at: clang/lib/AST/ExprConstant.cpp:1927
+      const Expr *Object = MCE->getImplicitObjectArgument();
+      Object->printPretty(Out, nullptr, Info.Ctx.getPrintingPolicy(), 0);
+      if (Object->getType()->isPointerType())
----------------



================
Comment at: clang/lib/AST/ExprConstant.cpp:1934-1935
+                   dyn_cast_if_present<CXXOperatorCallExpr>(CallExpr)) {
+      OCE->getArg(0)->printPretty(Out, nullptr, Info.Ctx.getPrintingPolicy(),
+                                  0);
+      Out << ".";
----------------



================
Comment at: clang/lib/AST/ExprConstant.cpp:16289
   // Fabricate a call stack frame to give the arguments a plausible cover story.
-  CallStackFrame Frame(Info, SourceLocation(), FD, /*This*/ nullptr, CallRef());
+  CallStackFrame Frame(Info, SourceLocation(), FD, /*This*/ nullptr,
+                       /*CallExpr=*/nullptr, CallRef());
----------------



CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151720/new/

https://reviews.llvm.org/D151720



More information about the cfe-commits mailing list