/// then we treat @p From as an rvalue, even if it is an lvalue.
ImplicitConversionSequence
Sema::TryCopyInitialization(Expr *From, QualType ToType,
- bool SuppressUserConversions, bool ForceRValue) {
+ bool SuppressUserConversions, bool ForceRValue,
+ bool InOverloadResolution) {
if (ToType->isReferenceType()) {
ImplicitConversionSequence ICS;
CheckReferenceInit(From, ToType,
QualType ParamType = Proto->getArgType(ArgIdx);
Candidate.Conversions[ArgIdx]
= TryCopyInitialization(Args[ArgIdx], ParamType,
- SuppressUserConversions, ForceRValue);
+ SuppressUserConversions, ForceRValue,
+ /*InOverloadResolution=*/true);
if (Candidate.Conversions[ArgIdx].ConversionKind
== ImplicitConversionSequence::BadConversion) {
Candidate.Viable = false;
QualType ParamType = Proto->getArgType(ArgIdx);
Candidate.Conversions[ArgIdx + 1]
= TryCopyInitialization(Args[ArgIdx], ParamType,
- SuppressUserConversions, ForceRValue);
+ SuppressUserConversions, ForceRValue,
+ /*InOverloadResolution=*/false);
if (Candidate.Conversions[ArgIdx + 1].ConversionKind
== ImplicitConversionSequence::BadConversion) {
Candidate.Viable = false;
ImplicitConversionSequence ICS =
TryCopyInitialization(&Call, ToType,
/*SuppressUserConversions=*/true,
- /*ForceRValue=*/false);
+ /*ForceRValue=*/false,
+ /*InOverloadResolution=*/false);
switch (ICS.ConversionKind) {
case ImplicitConversionSequence::StandardConversion:
Candidate.Conversions[ArgIdx + 1]
= TryCopyInitialization(Args[ArgIdx], ParamType,
/*SuppressUserConversions=*/false,
- /*ForceRValue=*/false);
+ /*ForceRValue=*/false,
+ /*InOverloadResolution=*/false);
if (Candidate.Conversions[ArgIdx + 1].ConversionKind
== ImplicitConversionSequence::BadConversion) {
Candidate.Viable = false;
Candidate.Conversions[ArgIdx]
= TryCopyInitialization(Args[ArgIdx], ParamTys[ArgIdx],
ArgIdx == 0 && IsAssignmentOperator,
- /*ForceRValue=*/false);
+ /*ForceRValue=*/false,
+ /*InOverloadResolution=*/false);
}
if (Candidate.Conversions[ArgIdx].ConversionKind
== ImplicitConversionSequence::BadConversion) {