xref: /aosp_15_r20/external/pytorch/c10/util/TypeCast.cpp (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1 #include <c10/util/TypeCast.h>
2 
3 namespace c10 {
4 
report_overflow(const char * name)5 [[noreturn]] void report_overflow(const char* name) {
6   std::ostringstream oss;
7   oss << "value cannot be converted to type " << name << " without overflow";
8   throw std::runtime_error(oss.str()); // rather than domain_error (issue 33562)
9 }
10 
11 } // namespace c10
12