Replace throw err; to resolve clang-tidy error.

This commit is contained in:
Ralf W. Grosse-Kunstleve 2022-06-21 21:11:23 -07:00
parent ed4b50bb86
commit 3d064fcab3

View File

@ -71,16 +71,14 @@ void odr_guard_impl(const std::type_index &it_ti,
&& strcmp(source_file_line_basename(reg_iter->second.c_str()), && strcmp(source_file_line_basename(reg_iter->second.c_str()),
source_file_line_basename(source_file_line)) source_file_line_basename(source_file_line))
!= 0) { != 0) {
std::system_error err(std::make_error_code(std::errc::state_not_recoverable), std::string msg("ODR VIOLATION DETECTED: pybind11::detail::type_caster<"
"ODR VIOLATION DETECTED: pybind11::detail::type_caster<" + type_id<IntrinsicType>() + ">: SourceLocation1=\"" + reg_iter->second
+ type_id<IntrinsicType>() + ">: SourceLocation1=\"" + "\", SourceLocation2=\"" + source_file_line + "\"");
+ reg_iter->second + "\", SourceLocation2=\"" + source_file_line
+ "\"");
if (throw_disabled) { if (throw_disabled) {
std::fprintf(stderr, "\nDISABLED std::system_error: %s\n", err.what()); std::fprintf(stderr, "\nDISABLED std::system_error: %s\n", msg.c_str());
std::fflush(stderr); std::fflush(stderr);
} else { } else {
throw err; throw std::system_error(std::make_error_code(std::errc::state_not_recoverable), msg);
} }
} }
} }