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

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 17 12:56:42 PDT 2020


hokein marked 5 inline comments as done.
hokein added inline comments.


================
Comment at: clang/include/clang/Sema/Sema.h:3876
+                            llvm::function_ref<ExprResult(Expr *)> Filter,
+                            bool RecoverUncorrectedTypos = false) {
+    return CorrectDelayedTyposInExpr(ER, nullptr, RecoverUncorrectedTypos,
----------------
sammccall wrote:
> 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)
This method doesn't have too many usages, I'd just remove it, which leaves us two overloads (one for Expr, the other one for ExprResult).


================
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) {
----------------
sammccall wrote:
> could consider splitting this change out of the refactoring (or vice versa), up to you
split the refactoring change in https://reviews.llvm.org/D82047


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