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

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 31 20:39:43 PDT 2023


tbaeder added inline comments.


================
Comment at: clang/lib/AST/ExprConstant.cpp:1925
   if (This && IsMemberCall) {
-    APValue Val;
-    This->moveInto(Val);
-    Val.printPretty(Out, Info.Ctx,
-                    This->Designator.MostDerivedType);
-    // FIXME: Add parens around Val if needed.
-    Out << "->" << *Callee << '(';
+    if (const auto *MCE = dyn_cast_or_null<CXXMemberCallExpr>(CallExpr)) {
+      const Expr *Object = MCE->getImplicitObjectArgument();
----------------



================
Comment at: clang/lib/AST/ExprConstant.cpp:1933
+    } else if (const auto *OCE =
+                   dyn_cast_or_null<CXXOperatorCallExpr>(CallExpr)) {
+      OCE->getArg(0)->printPretty(Out, nullptr, Info.Ctx.getPrintingPolicy(),
----------------



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

https://reviews.llvm.org/D151720



More information about the cfe-commits mailing list