summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaCXXScopeSpec.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/SemaCXXScopeSpec.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/SemaCXXScopeSpec.cpp')
-rw-r--r--clang/lib/Sema/SemaCXXScopeSpec.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaCXXScopeSpec.cpp b/clang/lib/Sema/SemaCXXScopeSpec.cpp
index 68a1d7368e2..f943a10deb4 100644
--- a/clang/lib/Sema/SemaCXXScopeSpec.cpp
+++ b/clang/lib/Sema/SemaCXXScopeSpec.cpp
@@ -607,7 +607,7 @@ bool Sema::BuildCXXNestedNameSpecifier(Scope *S,
diagnoseTypo(Corrected, PDiag(diag::err_undeclared_var_use_suggest)
<< Name);
- if (NamedDecl *ND = Corrected.getCorrectionDecl())
+ if (NamedDecl *ND = Corrected.getFoundDecl())
Found.addDecl(ND);
Found.setLookupName(Corrected.getCorrection());
} else {
OpenPOWER on IntegriCloud