================
@@ -2245,6 +2245,17 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned 
BuiltinID, CallExpr *TheCall) {
 
     break;
   }
+  case Builtin::BI__builtin_hlsl_and: {
+    if (SemaRef.checkArgCount(TheCall, 2))
+      return true;
+    if (CheckVectorElementCallArgs(&SemaRef, TheCall))
+      return true;
+    ExprResult A = TheCall->getArg(0);
----------------
llvm-beanz wrote:

I think you're misunderstanding how this works. `__builtin_hlsl_and` should 
only accept bools. The `hlsl::and` function takes bools. When the function is 
called with something that isn't a bool, implicit conversions covert it to bool.

You can write `__builtin_hlsl_and(...)` in source and get all sorts of strange 
thing passed in without conversions happening.

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

Reply via email to