Add an InOverloadResolution flag to TryCopyInitialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80261 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index b4f2581..5c92e12 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -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) {