DIAG(err_undef_superclass, ERROR,
"cannot find interface declaration for %0, superclass of %1")
DIAG(err_duplicate_class_def, ERROR,
- "duplicate interface declaration for class '%0'")
+ "duplicate interface definition for class '%0'")
DIAG(warn_undef_protocolref, WARNING,
"cannot find protocol definition for %0")
DIAG(err_duplicate_protocol_def, ERROR,
- "duplicate protocol declaration of %0")
+ "duplicate protocol definition of %0")
DIAG(err_undef_interface, ERROR,
"cannot find interface declaration for %0")
DIAG(warn_dup_category_def, WARNING,
// 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;
// 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;
// Note: GCC doesn't produce any of the following errors.
@interface Super @end // expected-error {{previous definition is here}}
-@interface MyWpModule @end
+@interface MyWpModule @end // expected-note {{previous definition is here}}
@compatibility_alias MyAlias MyWpModule;
@compatibility_alias AliasForSuper Super;
-@interface MyAlias : AliasForSuper // expected-error {{duplicate interface declaration for class 'MyWpModule'}}
+@interface MyAlias : AliasForSuper // expected-error {{duplicate interface definition for class 'MyWpModule'}}
@end
@implementation MyAlias : AliasForSuper // expected-error {{conflicting super class name 'Super'}}
@protocol P -im1; @end
@protocol Q -im2; @end
-@interface A<P> @end
-@interface A<Q> @end // expected-error {{duplicate interface declaration for class 'A'}}
+@interface A<P> @end // expected-note {{previous definition is here}}
+@interface A<Q> @end // expected-error {{duplicate interface definition for class 'A'}}
-@protocol PP<P> @end
-@protocol PP<Q> @end // expected-error {{duplicate protocol declaration of 'PP'}}
+@protocol PP<P> @end // expected-note {{previous definition is here}}
+@protocol PP<Q> @end // expected-error {{duplicate protocol definition of 'PP'}}
@interface A(Cat)<P> @end // expected-note {{previous definition is here}}
@interface A(Cat)<Q> @end // expected-warning {{duplicate definition of category 'Cat' on interface 'A'}}
@interface OBJECT @end // expected-error {{previous definition is here}}
-@interface INTF1 : OBJECT @end
+@interface INTF1 : OBJECT @end // expected-note {{previous definition is here}}
-@interface INTF1 : OBJECT @end // expected-error {{duplicate interface declaration for class 'INTF1'}}
+@interface INTF1 : OBJECT @end // expected-error {{duplicate interface definition for class 'INTF1'}}
typedef int OBJECT; // expected-error {{previous definition is here}} \
expected-error {{redefinition of 'OBJECT' as different kind of symbol}}
@interface INTF1 : FOO
@end
-@interface INTF2 : INTF1
+@interface INTF2 : INTF1 // expected-note {{previous definition is here}}
@end
@class INTF1, INTF2;
-@interface INTF2 : INTF1 // expected-error {{duplicate interface declaration for class 'INTF2'}}
+@interface INTF2 : INTF1 // expected-error {{duplicate interface definition for class 'INTF2'}}
@end
@protocol p1 @end
-@protocol PROTO<p1>
+@protocol PROTO<p1> // expected-note {{previous definition is here}}
@end
-@protocol PROTO<p1> // expected-error {{duplicate protocol declaration of 'PROTO'}}
+@protocol PROTO<p1> // expected-error {{duplicate protocol definition of 'PROTO'}}
@end
@protocol PROTO3<p1, p1>
@interface SUPER @end
-@interface INTF1 : SUPER
+@interface INTF1 : SUPER // expected-note {{previous definition is here}}
@end
@interface INTF2 : INTF1
@interface INTF3 : Y // expected-error {{cannot find interface declaration for 'Y', superclass of 'INTF3'}}
@end
-@interface INTF1 // expected-error {{duplicate interface declaration for class 'INTF1'}}
+@interface INTF1 // expected-error {{duplicate interface definition for class 'INTF1'}}
@end
@implementation SUPER