summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseExprCXX.cpp
diff options
context:
space:
mode:
authorVolodymyr Sapsai <vsapsai@apple.com>2017-08-22 17:55:19 +0000
committerVolodymyr Sapsai <vsapsai@apple.com>2017-08-22 17:55:19 +0000
commitb0f1aae9b397e0c936887f535ee984f5e0cbd30e (patch)
tree920b57665b2eef7616d6f3fd1d3d78e30c9f5305 /clang/lib/Parse/ParseExprCXX.cpp
parent6a71f364f175a94a92cb26908b36d972734a611d (diff)
downloadbcm5719-llvm-b0f1aae9b397e0c936887f535ee984f5e0cbd30e.tar.gz
bcm5719-llvm-b0f1aae9b397e0c936887f535ee984f5e0cbd30e.zip
[Parser] Correct initalizer typos before lambda capture type is deduced.
This is the same assertion as in https://reviews.llvm.org/D25206 that is triggered when RecordLayoutBuilder tries to compute the size of a field (for capture "typo_boo" in the test case) whose type hasn't been deduced. The fix is to add CorrectDelayedTyposInExpr call to the cases when we aren't disambiguating between an Obj-C message send and a lambda expression. rdar://problem/31760839 Reviewers: rsmith, ahatanak Reviewed By: arphaman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D36853 llvm-svn: 311480
Diffstat (limited to 'clang/lib/Parse/ParseExprCXX.cpp')
-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 b95506294bf..6ef747f402c 100644
--- a/clang/lib/Parse/ParseExprCXX.cpp
+++ b/clang/lib/Parse/ParseExprCXX.cpp
@@ -966,6 +966,8 @@ Optional<unsigned> Parser::ParseLambdaIntroducer(LambdaIntroducer &Intro,
// that would be an error.
ParsedType InitCaptureType;
+ if (!Init.isInvalid())
+ Init = Actions.CorrectDelayedTyposInExpr(Init.get());
if (Init.isUsable()) {
// Get the pointer and store it in an lvalue, so we can use it as an
// out argument.
OpenPOWER on IntegriCloud