[PATCH] D25206: [Parser] Correct typo after lambda capture initializer is parsed

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 25 15:32:38 PDT 2016


rsmith added inline comments.


================
Comment at: lib/Parse/ParseExprCXX.cpp:951
           Init = ParseInitializer();
+          Init = Actions.CorrectDelayedTyposInExpr(Init.get());
 
----------------
ahatanak wrote:
> mehdi_amini wrote:
> > What happens when there is no typo correction to apply?
> If there are no typos, it just returns the same Expr. If there are typos but no corrections can be applied, it returns ExprError.
If `ParseInitializer` returned `ExprError()`, this will incorrectly convert it into `ExprResult()` (that is, it'll clear the 'invalid' flag). You should skip this step if the initializer expression is not valid.


https://reviews.llvm.org/D25206





More information about the cfe-commits mailing list