diff options
author | Kaelyn Takata <rikka@google.com> | 2015-01-21 00:04:19 +0000 |
---|---|---|
committer | Kaelyn Takata <rikka@google.com> | 2015-01-21 00:04:19 +0000 |
commit | 21a886936b796752acf1db1b7ed5f8aa06b2b771 (patch) | |
tree | 5d5dcd425baeea439c0c4def2cdb52569fae4aea /clang/lib/Sema/SemaDecl.cpp | |
parent | f5dcc1cbe6b03b401e8026775ef1ab7356c7056c (diff) | |
download | bcm5719-llvm-21a886936b796752acf1db1b7ed5f8aa06b2b771.tar.gz bcm5719-llvm-21a886936b796752acf1db1b7ed5f8aa06b2b771.zip |
Correct all typos in the initialization arguments, even if one could not
be corrected.
This fixes PR22250, which exposed the bug where if there's more than one
TypoExpr in the arguments, once one failed to be corrected none of the
TypoExprs after it would be handled at all thanks to an early return.
llvm-svn: 226624
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 8fbe82fd881..cd6ff6ce582 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -8841,11 +8841,12 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, }); if (Res.isInvalid()) { VDecl->setInvalidDecl(); - return; - } - if (Res.get() != Args[Idx]) + } else if (Res.get() != Args[Idx]) { Args[Idx] = Res.get(); + } } + if (VDecl->isInvalidDecl()) + return; InitializationSequence InitSeq(*this, Entity, Kind, Args); ExprResult Result = InitSeq.Perform(*this, Entity, Kind, Args, &DclT); |