================ @@ -12367,8 +12368,17 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, BuiltinOp != Builtin::BI__lzcnt && BuiltinOp != Builtin::BI__lzcnt64; - if (ZeroIsUndefined && !Val) - return Error(E); + if (!Val) { ---------------- overmighty wrote:
I'm not sure I understand. What would the `...` in `return Success(...` be? If the first argument is not zero then the builtin returns the leading/trailing zero count of that, even when called with 2 arguments, so we can't just `return Success(Val.count{l,r}_zero(), E);` on line 12379 of your suggested change as it would always return the second argument when the builtin is called with 2 arguments. https://github.com/llvm/llvm-project/pull/86577 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits