]> granicus.if.org Git - clang/commitdiff
Remove default argument from TryCopyInitialization.
authorAnders Carlsson <andersca@mac.com>
Thu, 27 Aug 2009 17:18:13 +0000 (17:18 +0000)
committerAnders Carlsson <andersca@mac.com>
Thu, 27 Aug 2009 17:18:13 +0000 (17:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80256 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/Sema.h
lib/Sema/SemaExprCXX.cpp
lib/Sema/SemaInit.cpp
lib/Sema/SemaOverload.cpp

index a5a0723256f88655bbd01c7bf073552e84db7411..2ed90d016469261c85dd6c7968b8308a16cc253e 100644 (file)
@@ -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);
 
index 85924948da799dac676061760882c191d6bb9754..870041dc87e8d99d541643f43dd6dadb348040f2 100644 (file)
@@ -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
index 405dd8489e26c8c6e463300c1d5ca005c4505d87..fb000089832a54cf40d9e69518c5db558805dbf8 100644 (file)
@@ -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"))
index dde5c287236430fd7bf22c85146d7958e023d990..52010ab514540d13be2bd73fbd9a60cd2a4436c7 100644 (file)
@@ -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) {