From 527488d99507efd64fa8a87af8bcd7f2cbd263f2 Mon Sep 17 00:00:00 2001 From: Leonardo Neumann Date: Sun, 15 Aug 2021 21:30:23 -0300 Subject: [PATCH] fix incompatibility when using libcxx --- src/error.cpp | 5 +++-- src/error.h | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/error.cpp b/src/error.cpp index cd8c7ad..5771764 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -26,6 +26,7 @@ #include #endif +#include #include #include @@ -100,7 +101,7 @@ const string &Error::backtrace() const { return backtrace_; } -const char* Error::what() const _GLIBCXX_USE_NOEXCEPT +const char* Error::what() const noexcept { return msg_.c_str(); } @@ -173,7 +174,7 @@ const string &ConfigError::filename() const const string &ConfigError::reason() const { return reason_; } -const char* ConfigError::what() const _GLIBCXX_USE_NOEXCEPT +const char* ConfigError::what() const noexcept { return msg_.c_str(); } diff --git a/src/error.h b/src/error.h index de2d90b..a2d407a 100644 --- a/src/error.h +++ b/src/error.h @@ -55,7 +55,7 @@ class Error : public std::exception { public: Error(const string &message = ""); - virtual const char* what() const _GLIBCXX_USE_NOEXCEPT override; + virtual const char* what() const noexcept override; const string &backtrace() const; }; @@ -115,7 +115,7 @@ class ConfigError : public ExpectedError { void set_filename(const string &filename); const string &filename() const; const string &reason() const; - virtual const char* what() const _GLIBCXX_USE_NOEXCEPT override; + virtual const char* what() const noexcept override; #ifdef USE_YAML ConfigError(const string &filename, const YAML::Mark &mark, const string &input, const string &msg); #endif