diff options
author | Kaelyn Takata <rikka@google.com> | 2014-10-27 18:07:29 +0000 |
---|---|---|
committer | Kaelyn Takata <rikka@google.com> | 2014-10-27 18:07:29 +0000 |
commit | 89c881b548753639e4abf8a6edf30edf22190275 (patch) | |
tree | 278309f84e85ce671e0f18e9901c67b3cb79fb0c /clang/lib/Parse/ParseTentative.cpp | |
parent | e1f49d545dbbf02c77dc297551101eab58cb2485 (diff) | |
download | bcm5719-llvm-89c881b548753639e4abf8a6edf30edf22190275.tar.gz bcm5719-llvm-89c881b548753639e4abf8a6edf30edf22190275.zip |
Pass around CorrectionCandidateCallbacks as unique_ptrs so
TypoCorrectionConsumer can keep the callback around as long as needed.
llvm-svn: 220693
Diffstat (limited to 'clang/lib/Parse/ParseTentative.cpp')
-rw-r--r-- | clang/lib/Parse/ParseTentative.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Parse/ParseTentative.cpp b/clang/lib/Parse/ParseTentative.cpp index 8463138e852..4b1375dfc18 100644 --- a/clang/lib/Parse/ParseTentative.cpp +++ b/clang/lib/Parse/ParseTentative.cpp @@ -1131,14 +1131,14 @@ Parser::isCXXDeclarationSpecifier(Parser::TPResult BracedCastResult, // a parse error one way or another. In that case, tell the caller that // this is ambiguous. Typo-correct to type and expression keywords and // to types and identifiers, in order to try to recover from errors. - CorrectionCandidateCallback TypoCorrection; - TypoCorrection.WantRemainingKeywords = false; - TypoCorrection.WantTypeSpecifiers = + auto TypoCorrection = llvm::make_unique<CorrectionCandidateCallback>(); + TypoCorrection->WantRemainingKeywords = false; + TypoCorrection->WantTypeSpecifiers = Next.is(tok::l_paren) || Next.is(tok::r_paren) || Next.is(tok::greater) || Next.is(tok::l_brace) || Next.is(tok::identifier); switch (TryAnnotateName(false /* no nested name specifier */, - &TypoCorrection)) { + std::move(TypoCorrection))) { case ANK_Error: return TPResult::Error; case ANK_TentativeDecl: |