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/Sema/SemaExprObjC.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/Sema/SemaExprObjC.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExprObjC.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp index ac28d833823..40ab95b6ec5 100644 --- a/clang/lib/Sema/SemaExprObjC.cpp +++ b/clang/lib/Sema/SemaExprObjC.cpp @@ -1744,10 +1744,11 @@ HandleExprPropertyRefExpr(const ObjCObjectPointerType *OPT, } // Attempt to correct for typos in property names. - DeclFilterCCC<ObjCPropertyDecl> Validator; - if (TypoCorrection Corrected = CorrectTypo( - DeclarationNameInfo(MemberName, MemberLoc), LookupOrdinaryName, - nullptr, nullptr, Validator, CTK_ErrorRecovery, IFace, false, OPT)) { + if (TypoCorrection Corrected = + CorrectTypo(DeclarationNameInfo(MemberName, MemberLoc), + LookupOrdinaryName, nullptr, nullptr, + llvm::make_unique<DeclFilterCCC<ObjCPropertyDecl>>(), + CTK_ErrorRecovery, IFace, false, OPT)) { diagnoseTypo(Corrected, PDiag(diag::err_property_not_found_suggest) << MemberName << QualType(OPT, 0)); DeclarationName TypoResult = Corrected.getCorrection(); @@ -1972,11 +1973,10 @@ Sema::ObjCMessageKind Sema::getObjCMessageKind(Scope *S, } } - ObjCInterfaceOrSuperCCC Validator(getCurMethodDecl()); - if (TypoCorrection Corrected = - CorrectTypo(Result.getLookupNameInfo(), Result.getLookupKind(), S, - nullptr, Validator, CTK_ErrorRecovery, nullptr, false, - nullptr, false)) { + if (TypoCorrection Corrected = CorrectTypo( + Result.getLookupNameInfo(), Result.getLookupKind(), S, nullptr, + llvm::make_unique<ObjCInterfaceOrSuperCCC>(getCurMethodDecl()), + CTK_ErrorRecovery, nullptr, false, nullptr, false)) { if (Corrected.isKeyword()) { // If we've found the keyword "super" (the only keyword that would be // returned by CorrectTypo), this is a send to super. |