diff options
-rw-r--r-- | clang.xcodeproj/project.pbxproj | 1 | ||||
-rw-r--r-- | lib/AST/Expr.cpp | 7 | ||||
-rw-r--r-- | test/CodeGenObjCXX/property-object-conditional-exp.mm | 4 |
3 files changed, 9 insertions, 3 deletions
diff --git a/clang.xcodeproj/project.pbxproj b/clang.xcodeproj/project.pbxproj index def722b45e..2a25645088 100644 --- a/clang.xcodeproj/project.pbxproj +++ b/clang.xcodeproj/project.pbxproj @@ -2039,7 +2039,6 @@ isa = PBXProject; buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */; compatibilityVersion = "Xcode 2.4"; - developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( English, diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index dbfe2d52b8..9536b9bf24 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -1661,7 +1661,12 @@ bool Expr::isTemporaryObject(ASTContext &C, const CXXRecordDecl *TempTy) const { const Expr *E = skipTemporaryBindingsAndNoOpCasts(this); // Temporaries are by definition pr-values of class type. - if (!E->Classify(C).isPRValue()) return false; + if (!E->Classify(C).isPRValue()) { + // In this context, property reference is a message call and is pr-value. + if (!isa<ObjCPropertyRefExpr>(E) && + !isa<ObjCImplicitSetterGetterRefExpr>(E)) + return false; + } // Black-list a few cases which yield pr-values of class type that don't // refer to temporaries of that type: diff --git a/test/CodeGenObjCXX/property-object-conditional-exp.mm b/test/CodeGenObjCXX/property-object-conditional-exp.mm index 0f44a2248a..826c351e79 100644 --- a/test/CodeGenObjCXX/property-object-conditional-exp.mm +++ b/test/CodeGenObjCXX/property-object-conditional-exp.mm @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm -o - %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s struct CGRect { char* origin; @@ -22,6 +22,8 @@ extern "C" bool CGRectIsEmpty(CGRect); CGRect dataRect; CGRect virtualBounds; +// CHECK: [[SRC:%.*]] = call %struct.CGRect bitcast (i8* (i8*, i8*, ...)* @objc_msgSend +// CHECK-NEXT:store %struct.CGRect [[SRC]], %struct.CGRect* dataRect = CGRectIsEmpty(virtualBounds) ? self.bounds : virtualBounds; dataRect = CGRectIsEmpty(virtualBounds) ? [self bounds] : virtualBounds; dataRect = CGRectIsEmpty(virtualBounds) ? virtualBounds : self.bounds; |