aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-12-07 22:54:16 +0000
committerJohn McCall <rjmccall@apple.com>2010-12-07 22:54:16 +0000
commit241d5580d2f3969d2cd2a94b4a92c762b5dc1e04 (patch)
tree057cbc3756809ace7543021e640adf57c5ef6912
parentcf55652cf668c1402eee0b12edd2e5a1bc34d7a1 (diff)
Bump up property conversion earlier in the initialization process. Fixes
the failed compile in PR8751. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121192 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/SemaExprCXX.cpp2
-rw-r--r--lib/Sema/SemaInit.cpp6
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index fb5428a6b4..100f787059 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -1850,7 +1850,7 @@ Sema::PerformImplicitConversion(Expr *&From, QualType ToType,
// Should this get its own ICK?
if (From->getObjectKind() == OK_ObjCProperty) {
ConvertPropertyForRValue(From);
- if (!From->isRValue()) break;
+ if (!From->isGLValue()) break;
}
FromType = FromType.getUnqualifiedType();
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp
index 6595927caf..555166076d 100644
--- a/lib/Sema/SemaInit.cpp
+++ b/lib/Sema/SemaInit.cpp
@@ -3100,6 +3100,10 @@ InitializationSequence::InitializationSequence(Sema &S,
return;
}
+ for (unsigned I = 0; I != NumArgs; ++I)
+ if (Args[I]->getObjectKind() == OK_ObjCProperty)
+ S.ConvertPropertyForRValue(Args[I]);
+
QualType SourceType;
Expr *Initializer = 0;
if (NumArgs == 1) {
@@ -3214,7 +3218,7 @@ InitializationSequence::InitializationSequence(Sema &S,
/*AllowExplicitConversions*/ false,
/*InOverloadResolution*/ false))
{
- if (Initializer->getType() == Context.OverloadTy )
+ if (Initializer->getType() == Context.OverloadTy)
SetFailed(InitializationSequence::FK_AddressOfOverloadFailed);
else
SetFailed(InitializationSequence::FK_ConversionFailed);