diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-12-29 19:43:10 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-12-29 19:43:10 +0000 |
commit | de6d6c486031bacf3097831dd9fe95b9dab59fe9 (patch) | |
tree | 1935a808b42cfa7547adf1f0b0fa564e86c52864 /clang/lib/Sema/SemaCXXScopeSpec.cpp | |
parent | b120ae96d342458905b5ab86cf60f9d508fc904f (diff) | |
download | bcm5719-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.cpp | 2 |
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 { |