diff options
author | Akira Hatanaka <ahatanaka@apple.com> | 2016-12-20 02:11:29 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@apple.com> | 2016-12-20 02:11:29 +0000 |
commit | 0d618872cdc401a702ca00285e409281753dcd9b (patch) | |
tree | 652512de3617fbbc551773e04223cbad55759e6c /lib/Parse/ParseExprCXX.cpp | |
parent | ce25d00e2e923bc08d758f8fecd526d5877407ab (diff) |
[Parser] Correct typo after lambda capture initializer is parsed.
This patch fixes an assertion that is triggered when RecordLayoutBuilder
tries to compute the size of a field (for capture "name" in the test
case) whose type hasn't been deduced. The patch fixes the bug by
correcting the typo of the capture initializer after the initializer is
parsed and before setting the expression for the annotation token.
Fixes PR30566.
rdar://problem/23380132
Differential Revision: https://reviews.llvm.org/D25206
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290156 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseExprCXX.cpp')
-rw-r--r-- | lib/Parse/ParseExprCXX.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Parse/ParseExprCXX.cpp b/lib/Parse/ParseExprCXX.cpp index 3f335747a4..ca1b3b1ad0 100644 --- a/lib/Parse/ParseExprCXX.cpp +++ b/lib/Parse/ParseExprCXX.cpp @@ -902,6 +902,8 @@ Optional<unsigned> Parser::ParseLambdaIntroducer(LambdaIntroducer &Intro, SourceLocation StartLoc = Tok.getLocation(); InMessageExpressionRAIIObject MaybeInMessageExpression(*this, true); Init = ParseInitializer(); + if (!Init.isInvalid()) + Init = Actions.CorrectDelayedTyposInExpr(Init.get()); if (Tok.getLocation() != StartLoc) { // Back out the lexing of the token after the initializer. |