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

Mehdi AMINI via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 25 15:43:35 PDT 2016


mehdi_amini added inline comments.


================
Comment at: lib/Parse/ParseExprCXX.cpp:951
           Init = ParseInitializer();
+          Init = Actions.CorrectDelayedTyposInExpr(Init.get());
 
----------------
rsmith wrote:
> 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.
I suggest having a test that exercise this code path.


https://reviews.llvm.org/D25206





More information about the cfe-commits mailing list