diff --git a/include/pybind11/attr.h b/include/pybind11/attr.h index 0c416709..50efdc7c 100644 --- a/include/pybind11/attr.h +++ b/include/pybind11/attr.h @@ -544,7 +544,7 @@ template ::value...), size_t self = constexpr_sum(std::is_same::value...)> constexpr bool expected_num_args(size_t nargs, bool has_args, bool has_kwargs) { - return named == 0 || (self + named + has_args + has_kwargs) == nargs; + return named == 0 || (self + named + size_t(has_args) + size_t(has_kwargs)) == nargs; } PYBIND11_NAMESPACE_END(detail)