summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaObjCProperty.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-03-23 19:02:22 +0000
committerTed Kremenek <kremenek@apple.com>2010-03-23 19:02:22 +0000
commit5921b83f54135612c36c54e61edabbe26a55ffb7 (patch)
tree9031662b2630b17f0ce7dc4de563e8ba0d073c31 /clang/lib/Sema/SemaObjCProperty.cpp
parent4d3745ade6baba16b7cec50c22ca41ce78f488ea (diff)
downloadbcm5719-llvm-5921b83f54135612c36c54e61edabbe26a55ffb7.tar.gz
bcm5719-llvm-5921b83f54135612c36c54e61edabbe26a55ffb7.zip
Improve diagnostic for @property/ivar type mismatch by including the types of the
ivar and @property respectively. llvm-svn: 99312
Diffstat (limited to 'clang/lib/Sema/SemaObjCProperty.cpp')
-rw-r--r--clang/lib/Sema/SemaObjCProperty.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp
index 030fdaafbc0..4dc734de8ae 100644
--- a/clang/lib/Sema/SemaObjCProperty.cpp
+++ b/clang/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.
OpenPOWER on IntegriCloud