[cfe-commits] r80260 - in /cfe/trunk/lib/Sema: Sema.h SemaCXXCast.cpp SemaDeclCXX.cpp SemaExprCXX.cpp SemaInit.cpp SemaOverload.cpp

Anders Carlsson andersca at mac.com
Thu Aug 27 10:30:44 PDT 2009


Author: andersca
Date: Thu Aug 27 12:30:43 2009
New Revision: 80260

URL: http://llvm.org/viewvc/llvm-project?rev=80260&view=rev
Log:
Remove more default arguments.

Modified:
    cfe/trunk/lib/Sema/Sema.h
    cfe/trunk/lib/Sema/SemaCXXCast.cpp
    cfe/trunk/lib/Sema/SemaDeclCXX.cpp
    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=80260&r1=80259&r2=80260&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/Sema.h (original)
+++ cfe/trunk/lib/Sema/Sema.h Thu Aug 27 12:30:43 2009
@@ -3371,10 +3371,10 @@
                                                       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++.

Modified: cfe/trunk/lib/Sema/SemaCXXCast.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCXXCast.cpp?rev=80260&r1=80259&r2=80260&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaCXXCast.cpp (original)
+++ cfe/trunk/lib/Sema/SemaCXXCast.cpp Thu Aug 27 12:30:43 2009
@@ -763,7 +763,11 @@
     // 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)

Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=80260&r1=80259&r2=80260&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Thu Aug 27 12:30:43 2009
@@ -2837,9 +2837,9 @@
 /// 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();

Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=80260&r1=80259&r2=80260&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Thu Aug 27 12:30:43 2009
@@ -1201,7 +1201,10 @@
     //   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 @@
     // 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;

Modified: cfe/trunk/lib/Sema/SemaInit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaInit.cpp?rev=80260&r1=80259&r2=80260&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaInit.cpp (original)
+++ cfe/trunk/lib/Sema/SemaInit.cpp Thu Aug 27 12:30:43 2009
@@ -132,7 +132,10 @@
   //   (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 @@
     } 
 
     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.

Modified: cfe/trunk/lib/Sema/SemaOverload.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=80260&r1=80259&r2=80260&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaOverload.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOverload.cpp Thu Aug 27 12:30:43 2009
@@ -1925,8 +1925,11 @@
                             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 @@
   }
 
   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))





More information about the cfe-commits mailing list