aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExprObjC.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-11-18 19:01:18 +0000
committerJohn McCall <rjmccall@apple.com>2010-11-18 19:01:18 +0000
commit0943168ac126b8047f30f6bd215fbe7db14d61ba (patch)
treed4e607bc4eb0ea16a0398f41710e50ef3954e53c /lib/Sema/SemaExprObjC.cpp
parentf4bed3f768a1effac21f3089f4c05f9ab9c37fe3 (diff)
Add an assertion, fix a whole bunch of bugs, comment the assertion
out because there are still bugs left. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119722 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprObjC.cpp')
-rw-r--r--lib/Sema/SemaExprObjC.cpp31
1 files changed, 21 insertions, 10 deletions
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp
index a99a72f3c8..04b88e2bde 100644
--- a/lib/Sema/SemaExprObjC.cpp
+++ b/lib/Sema/SemaExprObjC.cpp
@@ -431,16 +431,20 @@ HandleExprPropertyRefExpr(const ObjCObjectPointerType *OPT,
return ExprError();
if (Getter) {
- QualType PType;
- PType = Getter->getSendResultType();
+ QualType PType = Getter->getSendResultType();
+ ExprValueKind VK = VK_LValue;
+ ExprObjectKind OK = OK_ObjCProperty;
+ if (!getLangOptions().CPlusPlus && !PType.hasQualifiers() &&
+ PType->isVoidType())
+ VK = VK_RValue, OK = OK_Ordinary;
+
if (Super)
return Owned(new (Context) ObjCImplicitSetterGetterRefExpr(Getter, PType,
- VK_LValue, OK_ObjCProperty,
- Setter, MemberLoc, SuperLoc, SuperType));
+ VK, OK, Setter, MemberLoc,
+ SuperLoc, SuperType));
else
return Owned(new (Context) ObjCImplicitSetterGetterRefExpr(Getter, PType,
- VK_LValue, OK_ObjCProperty,
- Setter, MemberLoc, BaseExpr));
+ VK, OK, Setter, MemberLoc, BaseExpr));
}
@@ -547,16 +551,23 @@ ActOnClassPropertyRefExpr(IdentifierInfo &receiverName,
if (Getter || Setter) {
QualType PType;
- if (Getter)
+ ExprValueKind VK = VK_LValue;
+ if (Getter) {
PType = Getter->getSendResultType();
- else {
+ if (!getLangOptions().CPlusPlus &&
+ !PType.hasQualifiers() && PType->isVoidType())
+ VK = VK_RValue;
+ } else {
for (ObjCMethodDecl::param_iterator PI = Setter->param_begin(),
E = Setter->param_end(); PI != E; ++PI)
PType = (*PI)->getType();
+ VK = VK_LValue;
}
+
+ ExprObjectKind OK = (VK == VK_RValue ? OK_Ordinary : OK_ObjCProperty);
+
return Owned(new (Context) ObjCImplicitSetterGetterRefExpr(
- Getter, PType, VK_LValue, OK_ObjCProperty,
- Setter,
+ Getter, PType, VK, OK, Setter,
propertyNameLoc, IFace, receiverNameLoc));
}
return ExprError(Diag(propertyNameLoc, diag::err_property_not_found)