summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-12-29 19:43:10 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-12-29 19:43:10 +0000
commitde6d6c486031bacf3097831dd9fe95b9dab59fe9 (patch)
tree1935a808b42cfa7547adf1f0b0fa564e86c52864 /clang/lib/Sema/SemaTemplate.cpp
parentb120ae96d342458905b5ab86cf60f9d508fc904f (diff)
downloadbcm5719-llvm-de6d6c486031bacf3097831dd9fe95b9dab59fe9.tar.gz
bcm5719-llvm-de6d6c486031bacf3097831dd9fe95b9dab59fe9.zip
Teach typo correction to properly handle mapping declarations to their
underlying decls. Preserve the found declaration throughout, and only map to the underlying declaration when we want to check whether it's the right kind. This allows us to provide the right source location for the found declaration, and prepares for the possibility of underlying decls with a different name from the found decl. llvm-svn: 256575
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplate.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index 4b130229b6c..6cc85883345 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/lib/Sema/SemaTemplate.cpp
@@ -329,8 +329,8 @@ void Sema::LookupTemplateName(LookupResult &Found,
Found.getLookupNameInfo(), Found.getLookupKind(), S, &SS,
std::move(FilterCCC), CTK_ErrorRecovery, LookupCtx)) {
Found.setLookupName(Corrected.getCorrection());
- if (Corrected.getCorrectionDecl())
- Found.addDecl(Corrected.getCorrectionDecl());
+ if (auto *ND = Corrected.getFoundDecl())
+ Found.addDecl(ND);
FilterAcceptableTemplateNames(Found);
if (!Found.empty()) {
if (LookupCtx) {
OpenPOWER on IntegriCloud