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 | 67dd1d4df1b28973e12e0981129b2517d2033b66 (patch) | |
tree | 0340d2c464e0086d8b46b310221a19b926b82ca9 /lib/Sema/SemaTemplate.cpp | |
parent | f44d9e89e4374d49da1ccd74e0354e8965b867d6 (diff) |
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).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92877 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplate.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index 8c6aa6a7d4..ecb89edcf7 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/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 { |