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

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

index b19368816b58849bb1839d187f81f074cc631bc2..45e66694620f97cbbe0d57968dedb5b34eacc821 100644 (file)
@@ -3371,10 +3371,10 @@ public:
                                                       bool& DerivedToBase);
 
   bool CheckReferenceInit(Expr *&simpleInit_or_initList, QualType declType,
-                          ImplicitConversionSequence *ICS = 0,
-                          bool SuppressUserConversions = false,
-                          bool AllowExplicit = false,
-                          bool ForceRValue = false);
+                          bool SuppressUserConversions,
+                          bool AllowExplicit,
+                          bool ForceRValue,
+                          ImplicitConversionSequence *ICS = 0);
 
   /// CheckCastTypes - Check type constraints for casting between types under
   /// C semantics, or forward to CXXCheckCStyleCast in C++.
index 3643b8808eb79a358de55755a06690f1226296c3..b07635779bd465828eb4cfde7d8406f3865a8c7b 100644 (file)
@@ -763,7 +763,11 @@ TryStaticImplicitCast(Sema &Self, Expr *SrcExpr, QualType DestType,
     // the reinterpret_cast way. In that case, we pass an ICS so we don't
     // get error messages.
     ImplicitConversionSequence ICS;
-    bool failed = Self.CheckReferenceInit(SrcExpr, DestType, CStyle ? &ICS : 0);
+    bool failed = Self.CheckReferenceInit(SrcExpr, DestType, 
+                                          /*SuppressUserConversions=*/false,
+                                          /*AllowExplicit=*/false,
+                                          /*ForceRValue=*/false,
+                                          CStyle ? &ICS : 0);
     if (!failed)
       return TC_Success;
     if (CStyle)
index eb4299f79cf3cb2394b05c29fa97e762bce038d4..ed01a7f2d0704cd32fa9b95e45f9008fc5968de2 100644 (file)
@@ -2837,9 +2837,9 @@ Sema::CompareReferenceRelationship(QualType T1, QualType T2,
 /// When @p ForceRValue, we unconditionally treat the initializer as an rvalue.
 bool 
 Sema::CheckReferenceInit(Expr *&Init, QualType DeclType,
-                         ImplicitConversionSequence *ICS,
                          bool SuppressUserConversions,
-                         bool AllowExplicit, bool ForceRValue) {
+                         bool AllowExplicit, bool ForceRValue,
+                         ImplicitConversionSequence *ICS) {
   assert(DeclType->isReferenceType() && "Reference init needs a reference");
 
   QualType T1 = DeclType->getAs<ReferenceType>()->getPointeeType();
index 98b3d29e531631fea20d50a95f89db3929dbcdcf..55417c77d65f2769a212179cb2532bc92ab841b7 100644 (file)
@@ -1201,7 +1201,10 @@ static bool TryClassUnification(Sema &Self, Expr *From, Expr *To,
     //   conversion the reference must bind directly to E1.
     if (!Self.CheckReferenceInit(From,
                             Self.Context.getLValueReferenceType(To->getType()),
-                            &ICS))
+                                 /*SuppressUserConversions=*/false,
+                                 /*AllowExplicit=*/false,
+                                 /*ForceRValue=*/false,
+                                 &ICS))
     {
       assert((ICS.ConversionKind ==
                   ImplicitConversionSequence::StandardConversion ||
@@ -1317,14 +1320,20 @@ static bool ConvertForConditional(Sema &Self, Expr *&E,
     // FIXME: CheckReferenceInit should be able to reuse the ICS instead of
     // redoing all the work.
     return Self.CheckReferenceInit(E, Self.Context.getLValueReferenceType(
-                                        TargetType(ICS)));
+                                        TargetType(ICS)),
+                                   /*SuppressUserConversions=*/false,
+                                   /*AllowExplicit=*/false,
+                                   /*ForceRValue=*/false);
   }
   if (ICS.ConversionKind == ImplicitConversionSequence::UserDefinedConversion &&
       ICS.UserDefined.After.ReferenceBinding) {
     assert(ICS.UserDefined.After.DirectBinding &&
            "TryClassUnification should never generate indirect ref bindings");
     return Self.CheckReferenceInit(E, Self.Context.getLValueReferenceType(
-                                        TargetType(ICS)));
+                                        TargetType(ICS)),
+                                   /*SuppressUserConversions=*/false,
+                                   /*AllowExplicit=*/false,
+                                   /*ForceRValue=*/false);
   }
   if (Self.PerformImplicitConversion(E, TargetType(ICS), ICS, "converting"))
     return true;
index fb000089832a54cf40d9e69518c5db558805dbf8..f545db83f62271a8e44a7a830aea8af1025e5a54 100644 (file)
@@ -132,7 +132,10 @@ bool Sema::CheckInitializerTypes(Expr *&Init, QualType &DeclType,
   //   (8.3.2), shall be initialized by an object, or function, of
   //   type T or by an object that can be converted into a T.
   if (DeclType->isReferenceType())
-    return CheckReferenceInit(Init, DeclType, 0, false, DirectInit);
+    return CheckReferenceInit(Init, DeclType, 
+                              /*SuppressUserConversions=*/false,
+                              /*AllowExplicit=*/DirectInit,
+                              /*ForceRValue=*/false);
   
   // C99 6.7.8p3: The type of the entity to be initialized shall be an array
   // of unknown size ("[]") or an object type that is not a variable array type.
@@ -777,7 +780,10 @@ void InitListChecker::CheckReferenceType(InitListExpr *IList, QualType DeclType,
     } 
 
     Expr *savExpr = expr; // Might be promoted by CheckSingleInitializer.
-    if (SemaRef.CheckReferenceInit(expr, DeclType))
+    if (SemaRef.CheckReferenceInit(expr, DeclType,
+                                   /*SuppressUserConversions=*/false,
+                                   /*AllowExplicit=*/false,
+                                   /*ForceRValue=*/false))                                   
       hadError = true;
     else if (savExpr != expr) {
       // The type was promoted, update initializer list.
index b1364a9faab46eed45e4852b43de73a1ea585152..b4f25812ba2d9953f8e408624f50a6e5d2c1fb70 100644 (file)
@@ -1925,8 +1925,11 @@ Sema::TryCopyInitialization(Expr *From, QualType ToType,
                             bool SuppressUserConversions, bool ForceRValue) {
   if (ToType->isReferenceType()) {
     ImplicitConversionSequence ICS;
-    CheckReferenceInit(From, ToType, &ICS, SuppressUserConversions,
-                       /*AllowExplicit=*/false, ForceRValue);
+    CheckReferenceInit(From, ToType, 
+                       SuppressUserConversions,
+                       /*AllowExplicit=*/false,
+                       ForceRValue,
+                       &ICS);
     return ICS;
   } else {
     return TryImplicitConversion(From, ToType, 
@@ -1958,7 +1961,10 @@ bool Sema::PerformCopyInitialization(Expr *&From, QualType ToType,
   }
 
   if (ToType->isReferenceType())
-    return CheckReferenceInit(From, ToType);
+    return CheckReferenceInit(From, ToType,
+                              /*SuppressUserConversions=*/false,
+                              /*AllowExplicit=*/false,
+                              /*ForceRValue=*/false);
 
   if (!PerformImplicitConversion(From, ToType, Flavor,
                                  /*AllowExplicit=*/false, Elidable))