]> granicus.if.org Git - clang/commitdiff
objc: note location of the previously declared
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 12 Oct 2011 00:00:57 +0000 (00:00 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 12 Oct 2011 00:00:57 +0000 (00:00 +0000)
property in the diagnostic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141745 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaObjCProperty.cpp
test/SemaObjC/property-category-3.m
test/SemaObjC/property-inherited.m

index df95396ee49517698808785a78c1ee8eccd9255f..063b4abfb2a7bd592ba5ab22572b83f31716d9b9 100644 (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);
+    }
   }
 }
 
index 237de0f1f5fb5cd0297687a6f7b0067b737b7602..2a61d927247766dff4cd6dbfcb97a02d76d832a3 100644 (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>
index 11ef2befa99b8d727fe458358565db12a03c2ca0..f5f1b420c229834877bdcfe537da946fcec63325 100644 (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