================
@@ -14240,6 +14294,114 @@ StmtResult Sema::ActOnCXXForRangeIdentifier(Scope *S, 
SourceLocation IdentLoc,
                                                       : IdentLoc);
 }
 
+static ImplicitConversionKind getConversionKind(QualType FromType,
+                                                QualType ToType) {
+  if (ToType->isIntegerType()) {
+    if (FromType->isComplexType())
+      return ICK_Complex_Real;
+    if (FromType->isFloatingType())
+      return ICK_Floating_Integral;
+    if (FromType->isIntegerType())
+      return ICK_Integral_Conversion;
+  }
+
+  if (ToType->isFloatingType()) {
+    if (FromType->isComplexType())
+      return ICK_Complex_Real;
+    if (FromType->isFloatingType())
+      return ICK_Floating_Conversion;
+    if (FromType->isIntegerType())
+      return ICK_Floating_Integral;
+  }
+
+  return ICK_Identity;
+}
----------------
Fznamznon wrote:

> I wonder if we should expose (some of) the logic of IsStandardConversion() 
> from SemaOverload.cpp

You mean part starting from
https://github.com/llvm/llvm-project/blob/af65379e383bac651f0868237e9086630b15ee0d/clang/lib/Sema/SemaOverload.cpp#L2074
 ?

If yes, how this will help better with the problem of adding new conversions?

https://github.com/llvm/llvm-project/pull/73099
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to