aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaInit.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/SemaInit.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/SemaInit.cpp')
-rw-r--r--lib/Sema/SemaInit.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp
index 54d94f86ce..c2a62cbc52 100644
--- a/lib/Sema/SemaInit.cpp
+++ b/lib/Sema/SemaInit.cpp
@@ -1302,6 +1302,9 @@ InitListChecker::CheckDesignatedInitializer(InitListExpr *IList,
<< FieldName << CurrentObjectType << R.getLookupName()
<< CodeModificationHint::CreateReplacement(D->getFieldLoc(),
R.getLookupName().getAsString());
+ SemaRef.Diag(ReplacementField->getLocation(),
+ diag::note_previous_decl)
+ << ReplacementField->getDeclName();
} else {
SemaRef.Diag(D->getFieldLoc(), diag::err_field_designator_unknown)
<< FieldName << CurrentObjectType;