summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-10-14 18:31:36 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-10-14 18:31:36 +0000
commit2e8b97c5fa0fa9070fafce1bf56eef0c35cf114f (patch)
tree68b9a90f5468613f8ba39073829585abafc2691a
parent72b2625aa67c8213acaf4bf6209b67859d60e2cf (diff)
Make value kind based on the return type of the getter, not
property type, for when getter may be a reference type. // rdar://10188258 revised. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141966 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/SemaExpr.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 3818e3d3a1..dca716c0d9 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -7205,15 +7205,15 @@ ExprResult Sema::ConvertPropertyForRValue(Expr *E) {
VK = Expr::getValueKindForType(GetterMethod->getResultType());
}
else {
+ // lvalue-ness of an explicit property is determined by
+ // getter type.
Diag(PRE->getLocation(), diag::err_getter_not_found)
<< PRE->getBase()->getType();
}
}
else {
- // lvalue-ness of an explicit property is determined by
- // property type.
- ObjCPropertyDecl *PDecl = PRE->getExplicitProperty();
- VK = Expr::getValueKindForType(PDecl->getType());
+ QualType ResT = PRE->getGetterResultType();
+ VK = Expr::getValueKindForType(ResT);
}
E = ImplicitCastExpr::Create(Context, T, CK_GetObjCProperty,