diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-01-07 00:17:44 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-01-07 00:17:44 +0000 |
commit | 6da83624e44a4066c31524d60d2226de55c698a0 (patch) | |
tree | af398a1c3c421d7db12977da2470c7036f385180 /clang/lib/Sema/SemaTemplate.cpp | |
parent | b907a467e2acee99ecc11cb91c32cf1a3c0ef68c (diff) | |
download | bcm5719-llvm-6da83624e44a4066c31524d60d2226de55c698a0.tar.gz bcm5719-llvm-6da83624e44a4066c31524d60d2226de55c698a0.zip |
Whenever we emit a typo-correction diagnostic, also emit a note
pointing to the declaration that we found that has that name (if it is
unique).
llvm-svn: 92877
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplate.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 8c6aa6a7d4a..ecb89edcf7d 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -219,6 +219,9 @@ void Sema::LookupTemplateName(LookupResult &Found, << Name << Found.getLookupName() << CodeModificationHint::CreateReplacement(Found.getNameLoc(), Found.getLookupName().getAsString()); + if (TemplateDecl *Template = Found.getAsSingle<TemplateDecl>()) + Diag(Template->getLocation(), diag::note_previous_decl) + << Template->getDeclName(); } else Found.clear(); } else { |