]> granicus.if.org Git - clang/commitdiff
Eliminate ForceRValue parameters from reference binding. Did I mention
authorDouglas Gregor <dgregor@apple.com>
Fri, 16 Apr 2010 17:45:54 +0000 (17:45 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 16 Apr 2010 17:45:54 +0000 (17:45 +0000)
that we aren't using ForceRValue any more?

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

lib/Sema/SemaInit.cpp
lib/Sema/SemaOverload.cpp

index 1293e8d6c5e7288b2095152d397bc4a76c7a8ef7..848d25efd03a35ef9f0c3309102be1e0ddcbbeb3 100644 (file)
@@ -2391,15 +2391,11 @@ static void TryReferenceInitialization(Sema &S,
     T2 = cv2T2.getUnqualifiedType();
   }
   
-  // FIXME: Rvalue references
-  bool ForceRValue = false;
-  
   // Compute some basic properties of the types and the initializer.
   bool isLValueRef = DestType->isLValueReferenceType();
   bool isRValueRef = !isLValueRef;
   bool DerivedToBase = false;
-  Expr::isLvalueResult InitLvalue = ForceRValue ? Expr::LV_InvalidExpression :
-                                    Initializer->isLvalue(S.Context);
+  Expr::isLvalueResult InitLvalue = Initializer->isLvalue(S.Context);
   Sema::ReferenceCompareResult RefRelationship
     = S.CompareReferenceRelationship(DeclLoc, cv1T1, cv2T2, DerivedToBase);
   
index 6d00ba198a35abdfd8fde296f5eacb6cb7573304..d3772d561e5e130462125a5ab47ba0062f8e2670 100644 (file)
@@ -2241,7 +2241,7 @@ static ImplicitConversionSequence
 TryReferenceInit(Sema &S, Expr *&Init, QualType DeclType,
                  SourceLocation DeclLoc,
                  bool SuppressUserConversions,
-                 bool AllowExplicit, bool ForceRValue) {
+                 bool AllowExplicit) {
   assert(DeclType->isReferenceType() && "Reference init needs a reference");
 
   // Most paths end in a failed conversion.
@@ -2264,8 +2264,7 @@ TryReferenceInit(Sema &S, Expr *&Init, QualType DeclType,
   // Compute some basic properties of the types and the initializer.
   bool isRValRef = DeclType->isRValueReferenceType();
   bool DerivedToBase = false;
-  Expr::isLvalueResult InitLvalue = ForceRValue ? Expr::LV_InvalidExpression :
-                                                  Init->isLvalue(S.Context);
+  Expr::isLvalueResult InitLvalue = Init->isLvalue(S.Context);
   Sema::ReferenceCompareResult RefRelationship
     = S.CompareReferenceRelationship(DeclLoc, T1, T2, DerivedToBase);
 
@@ -2513,8 +2512,7 @@ Sema::TryCopyInitialization(Expr *From, QualType ToType,
     return TryReferenceInit(*this, From, ToType,
                             /*FIXME:*/From->getLocStart(),
                             SuppressUserConversions,
-                            /*AllowExplicit=*/false,
-                            ForceRValue);
+                            /*AllowExplicit=*/false);
 
   return TryImplicitConversion(From, ToType,
                                SuppressUserConversions,
@@ -5147,10 +5145,9 @@ void CompleteNonViableCandidate(Sema &S, OverloadCandidate *Cand,
   assert(!Cand->Conversions[ConvIdx].isInitialized() &&
          "remaining conversion is initialized?");
 
-  // FIXME: these should probably be preserved from the overload
+  // FIXME: this should probably be preserved from the overload
   // operation somehow.
   bool SuppressUserConversions = false;
-  bool ForceRValue = false;
 
   const FunctionProtoType* Proto;
   unsigned ArgIdx = ConvIdx;
@@ -5174,7 +5171,8 @@ void CompleteNonViableCandidate(Sema &S, OverloadCandidate *Cand,
       Cand->Conversions[ConvIdx]
         = S.TryCopyInitialization(Args[ConvIdx],
                                   Cand->BuiltinTypes.ParamTypes[ConvIdx],
-                                  SuppressUserConversions, ForceRValue,
+                                  SuppressUserConversions, 
+                                  /*ForceRValue=*/false,
                                   /*InOverloadResolution*/ true);
     return;
   }
@@ -5185,7 +5183,8 @@ void CompleteNonViableCandidate(Sema &S, OverloadCandidate *Cand,
     if (ArgIdx < NumArgsInProto)
       Cand->Conversions[ConvIdx]
         = S.TryCopyInitialization(Args[ArgIdx], Proto->getArgType(ArgIdx),
-                                  SuppressUserConversions, ForceRValue,
+                                  SuppressUserConversions, 
+                                  /*ForceRValue=*/false,
                                   /*InOverloadResolution=*/true);
     else
       Cand->Conversions[ConvIdx].setEllipsis();