diff --git a/cpp/src/text/subword/load_hash_file.cu b/cpp/src/text/subword/load_hash_file.cu index 1e81e603ca8..2e98b88ccb4 100644 --- a/cpp/src/text/subword/load_hash_file.cu +++ b/cpp/src/text/subword/load_hash_file.cu @@ -125,7 +125,7 @@ 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) { std::string message("Line "); message += std::to_string(line_no) + ": "; message += "cannot convert integer from '"; @@ -133,7 +133,7 @@ uint32_t str_to_uint32(std::string const& str, uint64_t line_no) message += "': "; message += exc.what(); std::cerr << message << std::endl; - throw exc; + throw; } } @@ -147,7 +147,7 @@ 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 '"; @@ -155,7 +155,7 @@ uint64_t str_to_uint64(std::string const& str, uint64_t line_no) message += "': "; message += exc.what(); std::cerr << message << std::endl; - throw exc; + throw; } } } // namespace