r227267 - Cleanups, and add some FIXMEs. No functional change.

Richard Smith richard-llvm at metafoo.co.uk
Tue Jan 27 15:23:40 PST 2015


Author: rsmith
Date: Tue Jan 27 17:23:39 2015
New Revision: 227267

URL: http://llvm.org/viewvc/llvm-project?rev=227267&view=rev
Log:
Cleanups, and add some FIXMEs. No functional change.

Modified:
    cfe/trunk/lib/Sema/SemaOverload.cpp

Modified: cfe/trunk/lib/Sema/SemaOverload.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=227267&r1=227266&r2=227267&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaOverload.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOverload.cpp Tue Jan 27 17:23:39 2015
@@ -1134,16 +1134,14 @@ TryUserDefinedConversion(Sema &S, Expr *
     break;
 
   case OR_Ambiguous:
-    if (!SuppressUserConversions) {
-      ICS.setAmbiguous();
-      ICS.Ambiguous.setFromType(From->getType());
-      ICS.Ambiguous.setToType(ToType);
-      for (OverloadCandidateSet::iterator Cand = Conversions.begin();
-           Cand != Conversions.end(); ++Cand)
-        if (Cand->Viable)
-          ICS.Ambiguous.addConversion(Cand->Function);
-      break;
-    }
+    ICS.setAmbiguous();
+    ICS.Ambiguous.setFromType(From->getType());
+    ICS.Ambiguous.setToType(ToType);
+    for (OverloadCandidateSet::iterator Cand = Conversions.begin();
+         Cand != Conversions.end(); ++Cand)
+      if (Cand->Viable)
+        ICS.Ambiguous.addConversion(Cand->Function);
+    break;
 
     // Fall through.
   case OR_No_Viable_Function:
@@ -4479,7 +4477,9 @@ TryListConversion(Sema &S, InitListExpr
                                      InOverloadResolution,
                                      AllowObjCWritebackConversion);
     }
-    if (S.Context.getAsArrayType(ToType)) {
+    // FIXME: Check the other conditions here: array of character type,
+    // initializer is a string literal.
+    if (ToType->isArrayType()) {
       InitializedEntity Entity =
         InitializedEntity::InitializeParameter(S.Context, ToType,
                                                /*Consumed=*/false);
@@ -4506,6 +4506,8 @@ TryListConversion(Sema &S, InitListExpr
   //   default-constructible, and if all the elements of the initializer list
   //   can be implicitly converted to X, the implicit conversion sequence is
   //   the worst conversion necessary to convert an element of the list to X.
+  //
+  // FIXME: We're missing a lot of these checks.
   bool toStdInitializerList = false;
   QualType X;
   if (ToType->isArrayType())
@@ -4664,7 +4666,7 @@ TryListConversion(Sema &S, InitListExpr
     //      initializer list, the implicit conversion sequence is the one
     //      required to convert the element to the parameter type.
     unsigned NumInits = From->getNumInits();
-    if (NumInits == 1 && !dyn_cast<InitListExpr>(From->getInit(0)))
+    if (NumInits == 1 && !isa<InitListExpr>(From->getInit(0)))
       Result = TryCopyInitialization(S, From->getInit(0), ToType,
                                      SuppressUserConversions,
                                      InOverloadResolution,





More information about the cfe-commits mailing list