aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaCXXScopeSpec.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-01-07 00:17:44 +0000
committerDouglas Gregor <dgregor@apple.com>2010-01-07 00:17:44 +0000
commit67dd1d4df1b28973e12e0981129b2517d2033b66 (patch)
tree0340d2c464e0086d8b46b310221a19b926b82ca9 /lib/Sema/SemaCXXScopeSpec.cpp
parentf44d9e89e4374d49da1ccd74e0354e8965b867d6 (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/SemaCXXScopeSpec.cpp')
-rw-r--r--lib/Sema/SemaCXXScopeSpec.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Sema/SemaCXXScopeSpec.cpp b/lib/Sema/SemaCXXScopeSpec.cpp
index 82d58eab1a..a8f118ebdd 100644
--- a/lib/Sema/SemaCXXScopeSpec.cpp
+++ b/lib/Sema/SemaCXXScopeSpec.cpp
@@ -446,6 +446,10 @@ Sema::CXXScopeTy *Sema::BuildCXXNestedNameSpecifier(Scope *S,
<< Name << Found.getLookupName()
<< CodeModificationHint::CreateReplacement(Found.getNameLoc(),
Found.getLookupName().getAsString());
+
+ if (NamedDecl *ND = Found.getAsSingle<NamedDecl>())
+ Diag(ND->getLocation(), diag::note_previous_decl)
+ << ND->getDeclName();
} else
Found.clear();
}