Mark Exception::Throw as noreturn, fix windows build.
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Deukhoofd 2021-11-21 12:30:35 +01:00
parent 1be055760a
commit 52130fa8a5
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 11 additions and 11 deletions

View File

@ -61,6 +61,17 @@ namespace ArbUt {
#endif #endif
{ {
} }
template <typename... Args>
[[noreturn]] static void Throw(const std::string& expression, const std::source_location& location,
const Args... args) {
std::stringstream error;
error << "[" << file_name(location.file_name()) << ":" << location.line() << "] \"";
error << expression;
using List = int[];
(void)List{0, ((void)(error << args), 0)...};
error << "\"";
throw Exception(error.str());
}
/// @brief Returns the error message of the exception. /// @brief Returns the error message of the exception.
[[nodiscard]] const char* what() const _GLIBCXX_TXN_SAFE_DYN _GLIBCXX_NOTHROW final { [[nodiscard]] const char* what() const _GLIBCXX_TXN_SAFE_DYN _GLIBCXX_NOTHROW final {
@ -117,17 +128,6 @@ namespace ArbUt {
return ss.str(); return ss.str();
} }
template <typename... Args>
static void Throw(const std::string& expression, const std::source_location& location, const Args... args) {
std::stringstream error;
error << "[" << file_name(location.file_name()) << ":" << location.line() << "] \"";
error << expression;
using List = int[];
(void)List{0, ((void)(error << args), 0)...};
error << "\"";
throw Exception(error.str());
}
private: private:
static void AppendNoSourceStack(std::stringstream& ss, const backward::ResolvedTrace& trace, static void AppendNoSourceStack(std::stringstream& ss, const backward::ResolvedTrace& trace,
bool include_addr) { bool include_addr) {