make some objc redefinition warnings more consistent: call definitions
"definitions", not declarations. Point out the location of the
original definition.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59919 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 7ffae47..c030a37 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -76,6 +76,8 @@
// Class already seen. Is it a forward declaration?
if (!IDecl->isForwardDecl()) {
Diag(AtInterfaceLoc, diag::err_duplicate_class_def) << IDecl->getName();
+ Diag(IDecl->getLocation(), diag::note_previous_definition);
+
// Return the previous class interface.
// FIXME: don't leak the objects passed in!
return IDecl;
@@ -188,6 +190,7 @@
// Protocol already seen. Better be a forward protocol declaration
if (!PDecl->isForwardDecl()) {
Diag(ProtocolLoc, diag::err_duplicate_protocol_def) << ProtocolName;
+ Diag(PDecl->getLocation(), diag::note_previous_definition);
// Just return the protocol we already had.
// FIXME: don't leak the objects passed in!
return PDecl;