From e6447ef98952cb38c8fcde42523406bb9dd7359a Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 23 Nov 2008 22:46:27 +0000 Subject: make some objc redefinition warnings more consistent: call definitions "definitions", not declarations. Point out the location of the original definition. llvm-svn: 59919 --- clang/lib/Sema/SemaDeclObjC.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang/lib/Sema/SemaDeclObjC.cpp') diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index 7ffae4725c8..c030a370e40 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/lib/Sema/SemaDeclObjC.cpp @@ -76,6 +76,8 @@ ActOnStartClassInterface(SourceLocation AtInterfaceLoc, // 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 @@ Sema::ActOnStartProtocolInterface(SourceLocation AtProtoInterfaceLoc, // 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; -- cgit v1.2.3