[PATCH] D142187: [clang] Fix typos in member initializers

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 20 01:51:10 PST 2023


ilya-biryukov added a comment.

Randomly chiming in here.
I never had a good model of where `CorrectDelayedTyposInExpr`, but wanted to note that `ActOnFullExpr` also calls it. This may be fine, I just wanted to mention it as it stood out.



================
Comment at: clang/lib/Sema/SemaDeclCXX.cpp:4101
 
-  ExprResult Init = InitExpr;
-  if (!FD->getType()->isDependentType() && !InitExpr->isTypeDependent()) {
-    Init = ConvertMemberDefaultInitExpression(FD, InitExpr, InitLoc);
+  ExprResult Init = CorrectDelayedTyposInExpr(InitExpr, /*InitDecl=*/nullptr,
+                                              /*RecoverUncorrectedTypos=*/true);
----------------
Should we pass `FD` here to avoid correcting to itself?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142187



More information about the cfe-commits mailing list