================
@@ -280,6 +280,22 @@ constexpr bool4 isinf(double4 V) { return 
isinf((float4)V); }
 _DXC_COMPAT_TERNARY_DOUBLE_OVERLOADS(lerp)
 _DXC_COMPAT_TERNARY_INTEGER_OVERLOADS(lerp)
 
+//===----------------------------------------------------------------------===//
+// lit builtins overloads
+//===----------------------------------------------------------------------===//
+
+template <typename T>
+constexpr __detail::enable_if_t<__detail::is_arithmetic<T>::Value &&
+                                    (__detail::is_same<double, T>::value ||
----------------
farzonl wrote:

> I don't understand why `lit(bool,bool,bool)` isn't ambiguous.
> 
> C++ doesn't have half types, but defining two functions 
> `lit(float,float,float)` and `lit(double,double,double)` and then calling 
> `lit(bool,bool,bool)` results in a compilation error `error: call to 'lit' is 
> ambiguous` in Clang as seen here: https://godbolt.org/z/Y3ThTfEs9 Is there 
> special case handling for overload resolution implemented for HLSL?

This falls under a compat overload cast that @kmpeng  most recent change makes 
more clear. https://hlsl.godbolt.org/z/vG7rY9WrT

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

Reply via email to