mirror of
https://github.com/intel/llvm.git
synced 2026-02-06 06:31:50 +08:00
Remove default argument from TryCopyInitialization.
llvm-svn: 80256
This commit is contained in:
@@ -766,8 +766,7 @@ public:
|
||||
|
||||
ImplicitConversionSequence
|
||||
TryCopyInitialization(Expr* From, QualType ToType,
|
||||
bool SuppressUserConversions = false,
|
||||
bool ForceRValue = false);
|
||||
bool SuppressUserConversions, bool ForceRValue);
|
||||
bool PerformCopyInitialization(Expr *&From, QualType ToType,
|
||||
const char *Flavor, bool Elidable = false);
|
||||
|
||||
|
||||
@@ -1228,7 +1228,9 @@ static bool TryClassUnification(Sema &Self, Expr *From, Expr *To,
|
||||
// Could still fail if there's no copy constructor.
|
||||
// FIXME: Is this a hard error then, or just a conversion failure? The
|
||||
// standard doesn't say.
|
||||
ICS = Self.TryCopyInitialization(From, TTy);
|
||||
ICS = Self.TryCopyInitialization(From, TTy,
|
||||
/*SuppressUserConversions=*/false,
|
||||
/*ForceRValue=*/false);
|
||||
}
|
||||
} else {
|
||||
// -- Otherwise: E1 can be converted to match E2 if E1 can be
|
||||
|
||||
@@ -661,7 +661,10 @@ void InitListChecker::CheckSubElementType(InitListExpr *IList,
|
||||
// an initializer-list. If the initializer can initialize a
|
||||
// member, the member is initialized. [...]
|
||||
ImplicitConversionSequence ICS
|
||||
= SemaRef.TryCopyInitialization(expr, ElemType);
|
||||
= SemaRef.TryCopyInitialization(expr, ElemType,
|
||||
/*SuppressUserConversions=*/false,
|
||||
/*ForceRValue=*/false);
|
||||
|
||||
if (ICS.ConversionKind != ImplicitConversionSequence::BadConversion) {
|
||||
if (SemaRef.PerformImplicitConversion(expr, ElemType, ICS,
|
||||
"initializing"))
|
||||
|
||||
@@ -2430,7 +2430,11 @@ Sema::AddConversionCandidate(CXXConversionDecl *Conversion,
|
||||
CallExpr Call(Context, &ConversionFn, 0, 0,
|
||||
Conversion->getConversionType().getNonReferenceType(),
|
||||
SourceLocation());
|
||||
ImplicitConversionSequence ICS = TryCopyInitialization(&Call, ToType, true);
|
||||
ImplicitConversionSequence ICS =
|
||||
TryCopyInitialization(&Call, ToType,
|
||||
/*SuppressUserConversions=*/true,
|
||||
/*ForceRValue=*/false);
|
||||
|
||||
switch (ICS.ConversionKind) {
|
||||
case ImplicitConversionSequence::StandardConversion:
|
||||
Candidate.FinalConversion = ICS.Standard;
|
||||
@@ -2543,7 +2547,8 @@ void Sema::AddSurrogateCandidate(CXXConversionDecl *Conversion,
|
||||
QualType ParamType = Proto->getArgType(ArgIdx);
|
||||
Candidate.Conversions[ArgIdx + 1]
|
||||
= TryCopyInitialization(Args[ArgIdx], ParamType,
|
||||
/*SuppressUserConversions=*/false);
|
||||
/*SuppressUserConversions=*/false,
|
||||
/*ForceRValue=*/false);
|
||||
if (Candidate.Conversions[ArgIdx + 1].ConversionKind
|
||||
== ImplicitConversionSequence::BadConversion) {
|
||||
Candidate.Viable = false;
|
||||
@@ -2674,7 +2679,8 @@ void Sema::AddBuiltinCandidate(QualType ResultTy, QualType *ParamTys,
|
||||
} else {
|
||||
Candidate.Conversions[ArgIdx]
|
||||
= TryCopyInitialization(Args[ArgIdx], ParamTys[ArgIdx],
|
||||
ArgIdx == 0 && IsAssignmentOperator);
|
||||
ArgIdx == 0 && IsAssignmentOperator,
|
||||
/*ForceRValue=*/false);
|
||||
}
|
||||
if (Candidate.Conversions[ArgIdx].ConversionKind
|
||||
== ImplicitConversionSequence::BadConversion) {
|
||||
|
||||
Reference in New Issue
Block a user