From 6da83624e44a4066c31524d60d2226de55c698a0 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Thu, 7 Jan 2010 00:17:44 +0000 Subject: 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 --- clang/lib/Sema/SemaDeclObjC.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/lib/Sema/SemaDeclObjC.cpp') diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index e5526746d9d..179255aedf9 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/lib/Sema/SemaDeclObjC.cpp @@ -142,6 +142,8 @@ ActOnStartClassInterface(SourceLocation AtInterfaceLoc, (PrevDecl = R.getAsSingle())) { Diag(SuperLoc, diag::err_undef_superclass_suggest) << SuperName << ClassName << PrevDecl->getDeclName(); + Diag(PrevDecl->getLocation(), diag::note_previous_decl) + << PrevDecl->getDeclName(); } } @@ -335,6 +337,8 @@ Sema::FindProtocolDeclaration(bool WarnOnDeclarations, (PDecl = R.getAsSingle())) { Diag(ProtocolId[i].second, diag::err_undeclared_protocol_suggest) << ProtocolId[i].first << R.getLookupName(); + Diag(PDecl->getLocation(), diag::note_previous_decl) + << PDecl->getDeclName(); } } -- cgit v1.2.3