diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-03-23 19:02:22 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-03-23 19:02:22 +0000 |
commit | f921a4868cf1876636f6684e7f68697b18c0cb47 (patch) | |
tree | 812cacbc1c0f9aaf87017017ef637a79a1145cd5 /lib/Sema/SemaObjCProperty.cpp | |
parent | 5fb12c6c8f64d4b69f65faefb7d0800d7e4bca66 (diff) |
Improve diagnostic for @property/ivar type mismatch by including the types of the
ivar and @property respectively.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99312 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaObjCProperty.cpp')
-rw-r--r-- | lib/Sema/SemaObjCProperty.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp index 030fdaafbc..4dc734de8a 100644 --- a/lib/Sema/SemaObjCProperty.cpp +++ b/lib/Sema/SemaObjCProperty.cpp @@ -383,7 +383,9 @@ Sema::DeclPtrTy Sema::ActOnPropertyImplDecl(SourceLocation AtLoc, if (PropType != IvarType) { if (CheckAssignmentConstraints(PropType, IvarType) != Compatible) { Diag(PropertyLoc, diag::error_property_ivar_type) - << property->getDeclName() << Ivar->getDeclName(); + << property->getDeclName() << PropType + << Ivar->getDeclName() << IvarType; + Diag(Ivar->getLocation(), diag::note_ivar_decl); // Note! I deliberately want it to fall thru so, we have a // a property implementation and to avoid future warnings. } @@ -396,7 +398,9 @@ Sema::DeclPtrTy Sema::ActOnPropertyImplDecl(SourceLocation AtLoc, if (lhsType != rhsType && lhsType->isArithmeticType()) { Diag(PropertyLoc, diag::error_property_ivar_type) - << property->getDeclName() << Ivar->getDeclName(); + << property->getDeclName() << PropType + << Ivar->getDeclName() << IvarType; + Diag(Ivar->getLocation(), diag::note_ivar_decl); // Fall thru - see previous comment } // __weak is explicit. So it works on Canonical type. |