[PATCH] D81395: [AST][RecoveryExpr] Preserve the invalid "undef_var" initializer.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 17 08:36:34 PDT 2020


sammccall accepted this revision.
sammccall added a comment.
This revision is now accepted and ready to land.

LG once the overload set is fixed



================
Comment at: clang/include/clang/Sema/Sema.h:3876
+                            llvm::function_ref<ExprResult(Expr *)> Filter,
+                            bool RecoverUncorrectedTypos = false) {
+    return CorrectDelayedTyposInExpr(ER, nullptr, RecoverUncorrectedTypos,
----------------
I think it's too confusing to have multiple overloads with different subsets of the parameters possible and also in different orders :-(

If there's nothing better, you could replace this with two overloads

CorrectDelayedTyposInExpr(ER, Filter)
CorrectDelayedTyposInExpr(ER, bool, Filter)


================
Comment at: clang/lib/Sema/SemaDecl.cpp:12014
       ExprResult Res = CorrectDelayedTyposInExpr(
-          Args[Idx], VDecl, [this, Entity, Kind](Expr *E) {
+          Args[Idx], VDecl, /*RecoverUncorrectedTypos=*/true,
+          [this, Entity, Kind](Expr *E) {
----------------
could consider splitting this change out of the refactoring (or vice versa), up to you


================
Comment at: clang/lib/Sema/SemaExprCXX.cpp:8318
+  FullExpr = CorrectDelayedTyposInExpr(FullExpr.get(), nullptr,
+                                       /*recoverUncorrectedTypos*/ true);
+  if (FullExpr.isInvalid())
----------------
/*RecoverUncorrectedTypos=*/


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81395





More information about the cfe-commits mailing list