objc: note location of the previously declared

property in the diagnostic.

llvm-svn: 141745
This commit is contained in:
Fariborz Jahanian 2011-10-12 00:00:57 +00:00
parent f192ca0761
commit fa643c8f3b
3 changed files with 6 additions and 4 deletions

View File

@ -936,9 +936,11 @@ Sema::DiagnosePropertyMismatch(ObjCPropertyDecl *Property,
QualType ConvertedType;
if (!isObjCPointerConversion(RHSType, LHSType,
ConvertedType, IncompatibleObjC) ||
IncompatibleObjC)
IncompatibleObjC) {
Diag(Property->getLocation(), diag::warn_property_types_are_incompatible)
<< Property->getType() << SuperProperty->getType() << inheritedName;
Diag(SuperProperty->getLocation(), diag::note_property_declare);
}
}
}

View File

@ -1,7 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
@protocol P
@property(readonly) int X;
@property(readonly) int X; // expected-note {{property declared here}}
@end
@protocol P1<P>

View File

@ -21,7 +21,7 @@
id _delegate;
}
@property(nonatomic, assign) id<FooDelegate> delegate;
@property(nonatomic, assign) id<BarDelegate> delegate2;
@property(nonatomic, assign) id<BarDelegate> delegate2; // expected-note {{property declared here}}
@end
@interface Bar : Foo {
}
@ -36,7 +36,7 @@
@interface Base : NSData
@property(assign) id ref;
@property(assign) Base *p_base;
@property(assign) NSMutableData *p_data;
@property(assign) NSMutableData *p_data; // expected-note {{property declared here}}
@end
@interface Data : Base