diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2013-10-16 17:51:43 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2013-10-16 17:51:43 +0000 |
commit | 289a0d810fb35c960f33c33ff8b7185c11d04d5f (patch) | |
tree | fafd58ae2f84a74311df975a9d2ce912960f0501 /lib/Sema/SemaPseudoObject.cpp | |
parent | d3d0dcfbf784c828c2f07384fd6a3401b0cd4e9e (diff) |
ObjectiveC++: support for passing C++11 style initialized temporaries to
objc++ properties using property-dot syntax.
// rdar://14654207
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192819 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaPseudoObject.cpp')
-rw-r--r-- | lib/Sema/SemaPseudoObject.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Sema/SemaPseudoObject.cpp b/lib/Sema/SemaPseudoObject.cpp index 106250fe0f..af74f0d4a3 100644 --- a/lib/Sema/SemaPseudoObject.cpp +++ b/lib/Sema/SemaPseudoObject.cpp @@ -730,6 +730,16 @@ ExprResult ObjCPropertyOpBuilder::buildSet(Expr *op, SourceLocation opcLoc, op = opResult.take(); assert(op && "successful assignment left argument invalid?"); } + else if (OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(op)) { + Expr *Initializer = OVE->getSourceExpr(); + // passing C++11 style initialized temporaries to objc++ properties + // requires special treatment by removing OpaqueValueExpr so type + // conversion takes place and adding the OpaqueValueExpr later on. + if (isa<InitListExpr>(Initializer) && + Initializer->getType()->isVoidType()) { + op = Initializer; + } + } } // Arguments. |