diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2011-10-03 17:58:21 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-10-03 17:58:21 +0000 |
commit | c6ac32283ea3d769ce51407e1aa1d52de6a5a010 (patch) | |
tree | fed828a6e9fc7bfa6748a4f05bc646fcae1d4a20 /lib/Sema/SemaExpr.cpp | |
parent | 25bedca83404020665b7246d537bda85492a2b3e (diff) |
objc++: Accessing explicit property of reference type need
not bind to a temporary. Fixes //rdar://10188258
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141009 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 1675568a56..707d577f61 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -7388,7 +7388,13 @@ ExprResult Sema::ConvertPropertyForRValue(Expr *E) { << PRE->getBase()->getType(); } } - + else { + // lvalue-ness of an explicit property is determined by + // property type. + ObjCPropertyDecl *PDecl = PRE->getExplicitProperty(); + VK = Expr::getValueKindForType(PDecl->getType()); + } + E = ImplicitCastExpr::Create(Context, T, CK_GetObjCProperty, E, 0, VK); |