summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@apple.com>2016-12-20 02:11:29 +0000
committerAkira Hatanaka <ahatanaka@apple.com>2016-12-20 02:11:29 +0000
commit51e60f9aeb09c7c25d31c70d414d2a7e0c9a03e3 (patch)
tree725f7eb62868f94106977a3e995276b861e18999 /clang/lib
parent5f4740d3e52b7726543b0104677e5fd02b7e5d61 (diff)
downloadbcm5719-llvm-51e60f9aeb09c7c25d31c70d414d2a7e0c9a03e3.tar.gz
bcm5719-llvm-51e60f9aeb09c7c25d31c70d414d2a7e0c9a03e3.zip
[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 llvm-svn: 290156
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Parse/ParseExprCXX.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseExprCXX.cpp b/clang/lib/Parse/ParseExprCXX.cpp
index 3f335747a4a..ca1b3b1ad01 100644
--- a/clang/lib/Parse/ParseExprCXX.cpp
+++ b/clang/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.
OpenPOWER on IntegriCloud