diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-04-16 17:45:54 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-04-16 17:45:54 +0000 |
| commit | adc7a704d2a385af08853596e5aaa9e2063fc2c9 (patch) | |
| tree | 8d9bacfcbf16fa81d3418360f649a78f61b8f602 /clang/lib/Sema/SemaOverload.cpp | |
| parent | 659d7fc0032762ad3506ae6de3d7c04c8d508790 (diff) | |
| download | bcm5719-llvm-adc7a704d2a385af08853596e5aaa9e2063fc2c9.tar.gz bcm5719-llvm-adc7a704d2a385af08853596e5aaa9e2063fc2c9.zip | |
Eliminate ForceRValue parameters from reference binding. Did I mention
that we aren't using ForceRValue any more?
llvm-svn: 101496
Diffstat (limited to 'clang/lib/Sema/SemaOverload.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaOverload.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index 6d00ba198a3..d3772d561e5 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -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(); |

