================ @@ -2245,6 +2245,36 @@ 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; + + // CheckVectorElementCallArgs(...) guarantees both args are the same type. + assert(TheCall->getArg(0)->getType() == TheCall->getArg(1)->getType() && + "Both args must be of the same type"); + + // check that the arguments are bools or, if vectors, + // vectors of bools + QualType ArgTy = TheCall->getArg(0)->getType(); + if (const auto *VecTy = ArgTy->getAs<VectorType>()) { + ArgTy = VecTy->getElementType(); + } + if (!getASTContext().hasSameUnqualifiedType(ArgTy, ---------------- llvm-beanz wrote:
Seriously? In that example we give _one_ error, and _two_ notes. The error tells you the call was ambiguous, and the note identifies the highest ranked ambiguous overloads. In a console, the one error is highlighted red. In an IDE the one error is collected and highlighted. The one error gets raised through LSP. Your proposal would issue multiple errors, each of which is individually not completely accurate. 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