[cfe-commits] r101481 - in /cfe/trunk/lib/Sema: Sema.h SemaExprCXX.cpp SemaInit.cpp

Douglas Gregor dgregor at apple.com
Fri Apr 16 10:16:43 PDT 2010


Author: dgregor
Date: Fri Apr 16 12:16:43 2010
New Revision: 101481

URL: http://llvm.org/viewvc/llvm-project?rev=101481&view=rev
Log:
Eliminate the Elidable parameter to PerformImplicitConversion; we
don't need it.

Modified:
    cfe/trunk/lib/Sema/Sema.h
    cfe/trunk/lib/Sema/SemaExprCXX.cpp
    cfe/trunk/lib/Sema/SemaInit.cpp

Modified: cfe/trunk/lib/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.h?rev=101481&r1=101480&r2=101481&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/Sema.h (original)
+++ cfe/trunk/lib/Sema/Sema.h Fri Apr 16 12:16:43 2010
@@ -4109,12 +4109,10 @@
 
   bool PerformImplicitConversion(Expr *&From, QualType ToType,
                                  AssignmentAction Action,
-                                 bool AllowExplicit = false,
-                                 bool Elidable = false);
+                                 bool AllowExplicit = false);
   bool PerformImplicitConversion(Expr *&From, QualType ToType,
                                  AssignmentAction Action,
                                  bool AllowExplicit,
-                                 bool Elidable,
                                  ImplicitConversionSequence& ICS);
   bool PerformImplicitConversion(Expr *&From, QualType ToType,
                                  const ImplicitConversionSequence& ICS,

Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=101481&r1=101480&r2=101481&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Fri Apr 16 12:16:43 2010
@@ -1479,38 +1479,23 @@
 /// error, false otherwise. The expression From is replaced with the
 /// converted expression. Flavor is the kind of conversion we're
 /// performing, used in the error message. If @p AllowExplicit,
-/// explicit user-defined conversions are permitted. @p Elidable should be true
-/// when called for copies which may be elided (C++ 12.8p15). C++0x overload
-/// resolution works differently in that case.
+/// explicit user-defined conversions are permitted.
 bool
 Sema::PerformImplicitConversion(Expr *&From, QualType ToType,
-                                AssignmentAction Action, bool AllowExplicit,
-                                bool Elidable) {
+                                AssignmentAction Action, bool AllowExplicit) {
   ImplicitConversionSequence ICS;
-  return PerformImplicitConversion(From, ToType, Action, AllowExplicit, 
-                                   Elidable, ICS);
+  return PerformImplicitConversion(From, ToType, Action, AllowExplicit, ICS);
 }
 
 bool
 Sema::PerformImplicitConversion(Expr *&From, QualType ToType,
                                 AssignmentAction Action, bool AllowExplicit,
-                                bool Elidable,
                                 ImplicitConversionSequence& ICS) {
-  ICS.setBad(BadConversionSequence::no_conversion, From, ToType);
-  if (Elidable && getLangOptions().CPlusPlus0x) {
-    ICS = TryImplicitConversion(From, ToType,
-                                /*SuppressUserConversions=*/false,
-                                AllowExplicit,
-                                /*ForceRValue=*/true,
-                                /*InOverloadResolution=*/false);
-  }
-  if (ICS.isBad()) {
-    ICS = TryImplicitConversion(From, ToType,
-                                /*SuppressUserConversions=*/false,
-                                AllowExplicit,
-                                /*ForceRValue=*/false,
-                                /*InOverloadResolution=*/false);
-  }
+  ICS = TryImplicitConversion(From, ToType,
+                              /*SuppressUserConversions=*/false,
+                              AllowExplicit,
+                              /*ForceRValue=*/false,
+                              /*InOverloadResolution=*/false);
   return PerformImplicitConversion(From, ToType, ICS, Action);
 }
 

Modified: cfe/trunk/lib/Sema/SemaInit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaInit.cpp?rev=101481&r1=101480&r2=101481&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaInit.cpp (original)
+++ cfe/trunk/lib/Sema/SemaInit.cpp Fri Apr 16 12:16:43 2010
@@ -3494,7 +3494,7 @@
         
     case SK_ConversionSequence:
         if (S.PerformImplicitConversion(CurInitExpr, Step->Type, Sema::AA_Converting, 
-                                      false, false, *Step->ICS))
+                                      false, *Step->ICS))
         return S.ExprError();
         
       CurInit.release();





More information about the cfe-commits mailing list