diff --git a/include/pybind11/detail/descr.h b/include/pybind11/detail/descr.h index e4baa383b..e5a5a77e2 100644 --- a/include/pybind11/detail/descr.h +++ b/include/pybind11/detail/descr.h @@ -64,6 +64,10 @@ struct src_loc { #endif +#ifdef PYBIND11_DETAIL_DESCR_SRC_LOC_ON +namespace { +#endif + /* Concatenate type signatures at compile time */ template struct descr { @@ -212,5 +216,9 @@ constexpr descr type_descr(const descr &descr) { return const_name("{", src_loc{nullptr, 0}) + descr + const_name("}"); } +#ifdef PYBIND11_DETAIL_DESCR_SRC_LOC_ON +} // namespace +#endif + PYBIND11_NAMESPACE_END(detail) PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE) diff --git a/include/pybind11/detail/type_caster_odr_guard.h b/include/pybind11/detail/type_caster_odr_guard.h index 4ae6d91fe..bfe28a79b 100644 --- a/include/pybind11/detail/type_caster_odr_guard.h +++ b/include/pybind11/detail/type_caster_odr_guard.h @@ -199,7 +199,7 @@ tu_local_no_data_always_false type_caster_odr_guard_impl( typeid(IntrinsicType), get_type_caster_source_file_line::source_file_line.text, - get_type_caster_source_file_line::source_file_line.sloc, + TypeCasterType::name.sloc, PYBIND11_DETAIL_TYPE_CASTER_ODR_GUARD_IMPL_THROW_DISABLED); return tu_local_no_data_always_false(); }();