Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix std::exeception catch-by-reference gcc9 compile error #7380

Merged
merged 2 commits into from
Feb 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cpp/src/text/subword/load_hash_file.cu
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ uint32_t str_to_uint32(std::string const& str, uint64_t line_no)
{
try {
return std::stoi(str); // there is no std::stoui
} catch (std::exception exc) {
} catch (std::exception const& exc) {
davidwendt marked this conversation as resolved.
Show resolved Hide resolved
std::string message("Line ");
message += std::to_string(line_no) + ": ";
message += "cannot convert integer from '";
message += str;
message += "': ";
message += exc.what();
std::cerr << message << std::endl;
throw exc;
throw;
}
}

Expand All @@ -147,15 +147,15 @@ uint64_t str_to_uint64(std::string const& str, uint64_t line_no)
{
try {
return std::stoul(str);
} catch (std::exception exc) {
} catch (std::exception const& exc) {
std::string message("Line ");
message += std::to_string(line_no) + ": ";
message += "cannot convert integer from '";
message += str;
message += "': ";
message += exc.what();
std::cerr << message << std::endl;
throw exc;
throw;
}
}
} // namespace
Expand Down