[cfe-commits] r80261 - in /cfe/trunk/lib/Sema: Sema.h SemaExprCXX.cpp SemaInit.cpp SemaOverload.cpp
Anders Carlsson
andersca at mac.com
Thu Aug 27 10:37:40 PDT 2009
Author: andersca
Date: Thu Aug 27 12:37:39 2009
New Revision: 80261
URL: http://llvm.org/viewvc/llvm-project?rev=80261&view=rev
Log:
Add an InOverloadResolution flag to TryCopyInitialization.
Modified:
cfe/trunk/lib/Sema/Sema.h
cfe/trunk/lib/Sema/SemaExprCXX.cpp
cfe/trunk/lib/Sema/SemaInit.cpp
cfe/trunk/lib/Sema/SemaOverload.cpp
Modified: cfe/trunk/lib/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.h?rev=80261&r1=80260&r2=80261&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/Sema.h (original)
+++ cfe/trunk/lib/Sema/Sema.h Thu Aug 27 12:37:39 2009
@@ -766,7 +766,8 @@
ImplicitConversionSequence
TryCopyInitialization(Expr* From, QualType ToType,
- bool SuppressUserConversions, bool ForceRValue);
+ bool SuppressUserConversions, bool ForceRValue,
+ bool InOverloadResolution);
bool PerformCopyInitialization(Expr *&From, QualType ToType,
const char *Flavor, bool Elidable = false);
Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=80261&r1=80260&r2=80261&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Thu Aug 27 12:37:39 2009
@@ -1238,7 +1238,8 @@
// standard doesn't say.
ICS = Self.TryCopyInitialization(From, TTy,
/*SuppressUserConversions=*/false,
- /*ForceRValue=*/false);
+ /*ForceRValue=*/false,
+ /*InOverloadResolution=*/false);
}
} else {
// -- Otherwise: E1 can be converted to match E2 if E1 can be
Modified: cfe/trunk/lib/Sema/SemaInit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaInit.cpp?rev=80261&r1=80260&r2=80261&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaInit.cpp (original)
+++ cfe/trunk/lib/Sema/SemaInit.cpp Thu Aug 27 12:37:39 2009
@@ -666,7 +666,8 @@
ImplicitConversionSequence ICS
= SemaRef.TryCopyInitialization(expr, ElemType,
/*SuppressUserConversions=*/false,
- /*ForceRValue=*/false);
+ /*ForceRValue=*/false,
+ /*InOverloadResolution=*/false);
if (ICS.ConversionKind != ImplicitConversionSequence::BadConversion) {
if (SemaRef.PerformImplicitConversion(expr, ElemType, ICS,
Modified: cfe/trunk/lib/Sema/SemaOverload.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=80261&r1=80260&r2=80261&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaOverload.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOverload.cpp Thu Aug 27 12:37:39 2009
@@ -1922,7 +1922,8 @@
/// 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,
@@ -2172,7 +2173,8 @@
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;
@@ -2288,7 +2290,8 @@
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;
@@ -2445,7 +2448,8 @@
ImplicitConversionSequence ICS =
TryCopyInitialization(&Call, ToType,
/*SuppressUserConversions=*/true,
- /*ForceRValue=*/false);
+ /*ForceRValue=*/false,
+ /*InOverloadResolution=*/false);
switch (ICS.ConversionKind) {
case ImplicitConversionSequence::StandardConversion:
@@ -2560,7 +2564,8 @@
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;
@@ -2692,7 +2697,8 @@
Candidate.Conversions[ArgIdx]
= TryCopyInitialization(Args[ArgIdx], ParamTys[ArgIdx],
ArgIdx == 0 && IsAssignmentOperator,
- /*ForceRValue=*/false);
+ /*ForceRValue=*/false,
+ /*InOverloadResolution=*/false);
}
if (Candidate.Conversions[ArgIdx].ConversionKind
== ImplicitConversionSequence::BadConversion) {
More information about the cfe-commits
mailing list