diff --git a/include/pybind11/detail/descr.h b/include/pybind11/detail/descr.h index d239830e2..5b20c8843 100644 --- a/include/pybind11/detail/descr.h +++ b/include/pybind11/detail/descr.h @@ -259,7 +259,8 @@ template constexpr auto concat(const descr &d, const Args &...args) -> decltype(std::declval>() + concat(args...)) { - return d + const_name(", ") + concat(args...); + // Ensure that src_loc of existing descr is used. + return d + const_name(", ", src_loc{nullptr, 0}) + concat(args...); } #endif