]> granicus.if.org Git - clang/commitdiff
Eliminate the Elidable parameter to PerformImplicitConversion; we
authorDouglas Gregor <dgregor@apple.com>
Fri, 16 Apr 2010 17:16:43 +0000 (17:16 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 16 Apr 2010 17:16:43 +0000 (17:16 +0000)
don't need it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101481 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 1be5f7af8880d6941d14255733e1873d9f3acad3..9c0903987785b31298cf59891c11241c7e479b18 100644 (file)
@@ -4109,12 +4109,10 @@ public:
 
   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,
index be3ef83d9944c842f1c3cacaccfbc655f010c27b..33cc63eb616f3d073bf86130929c934194fb08dc 100644 (file)
@@ -1479,38 +1479,23 @@ Sema::IsStringLiteralToNonConstPointerConversion(Expr *From, QualType ToType) {
 /// 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);
 }
 
index dae3d3ae7e68f75c993bbb1a6e46a0961a5ae2f5..1293e8d6c5e7288b2095152d397bc4a76c7a8ef7 100644 (file)
@@ -3494,7 +3494,7 @@ InitializationSequence::Perform(Sema &S,
         
     case SK_ConversionSequence:
         if (S.PerformImplicitConversion(CurInitExpr, Step->Type, Sema::AA_Converting, 
-                                      false, false, *Step->ICS))
+                                      false, *Step->ICS))
         return S.ExprError();
         
       CurInit.release();