]> granicus.if.org Git - clang/commitdiff
Bump up property conversion earlier in the initialization process. Fixes
authorJohn McCall <rjmccall@apple.com>
Tue, 7 Dec 2010 22:54:16 +0000 (22:54 +0000)
committerJohn McCall <rjmccall@apple.com>
Tue, 7 Dec 2010 22:54:16 +0000 (22:54 +0000)
the failed compile in PR8751.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121192 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExprCXX.cpp
lib/Sema/SemaInit.cpp

index fb5428a6b4a7df3693c9fb16286aaee93f089f0a..100f78705983a627b857c0cceb1ec261740a5797 100644 (file)
@@ -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();
index 6595927caf83820fb8e71645b4770f3a2cfb8553..555166076de4e8c7e0e483b664d4fafa58353595 100644 (file)
@@ -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);