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/Parser.cpp | |
parent | e1f49d545dbbf02c77dc297551101eab58cb2485 (diff) | |
download | llvm-89c881b548753639e4abf8a6edf30edf22190275.zip llvm-89c881b548753639e4abf8a6edf30edf22190275.tar.gz llvm-89c881b548753639e4abf8a6edf30edf22190275.tar.bz2 |
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/Parser.cpp')
-rw-r--r-- | clang/lib/Parse/Parser.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp index 93e893e..90d2815 100644 --- a/clang/lib/Parse/Parser.cpp +++ b/clang/lib/Parse/Parser.cpp @@ -1327,7 +1327,7 @@ void Parser::AnnotateScopeToken(CXXScopeSpec &SS, bool IsNewAnnotation) { /// no typo correction will be performed. Parser::AnnotatedNameKind Parser::TryAnnotateName(bool IsAddressOfOperand, - CorrectionCandidateCallback *CCC) { + std::unique_ptr<CorrectionCandidateCallback> CCC) { assert(Tok.is(tok::identifier) || Tok.is(tok::annot_cxxscope)); const bool EnteringContext = false; @@ -1365,9 +1365,9 @@ Parser::TryAnnotateName(bool IsAddressOfOperand, // after a scope specifier, because in general we can't recover from typos // there (eg, after correcting 'A::tempalte B<X>::C' [sic], we would need to // jump back into scope specifier parsing). - Sema::NameClassification Classification - = Actions.ClassifyName(getCurScope(), SS, Name, NameLoc, Next, - IsAddressOfOperand, SS.isEmpty() ? CCC : nullptr); + Sema::NameClassification Classification = Actions.ClassifyName( + getCurScope(), SS, Name, NameLoc, Next, IsAddressOfOperand, + SS.isEmpty() ? std::move(CCC) : nullptr); switch (Classification.getKind()) { case Sema::NC_Error: |