mirror of
https://github.com/Z3Prover/z3
synced 2025-08-03 01:40:22 +00:00
add noexcept for signature compatibility
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
75e46778fa
commit
42894f729a
3 changed files with 6 additions and 6 deletions
|
@ -28,14 +28,14 @@ class ex1 : public ex {
|
||||||
char const * m_msg;
|
char const * m_msg;
|
||||||
public:
|
public:
|
||||||
ex1(char const * m):m_msg(m) {}
|
ex1(char const * m):m_msg(m) {}
|
||||||
char const * what() const override { return m_msg; }
|
char const * what() const noexcept override { return m_msg; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class ex2 : public ex {
|
class ex2 : public ex {
|
||||||
std::string m_msg;
|
std::string m_msg;
|
||||||
public:
|
public:
|
||||||
ex2(char const * m):m_msg(m) {}
|
ex2(char const * m):m_msg(m) {}
|
||||||
char const * what() const override { return m_msg.c_str(); }
|
char const * what() const noexcept override { return m_msg.c_str(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
static void th() {
|
static void th() {
|
||||||
|
|
|
@ -35,7 +35,7 @@ z3_error::z3_error(unsigned error_code):m_error_code(error_code) {
|
||||||
SASSERT(error_code != 0);
|
SASSERT(error_code != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
char const * z3_error::what() const {
|
char const * z3_error::what() const noexcept {
|
||||||
switch (m_error_code) {
|
switch (m_error_code) {
|
||||||
case ERR_MEMOUT: return "out of memory";
|
case ERR_MEMOUT: return "out of memory";
|
||||||
case ERR_TIMEOUT: return "timeout";
|
case ERR_TIMEOUT: return "timeout";
|
||||||
|
@ -67,6 +67,6 @@ default_exception::default_exception(fmt, char const* msg, ...) {
|
||||||
m_msg = out.str();
|
m_msg = out.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
char const * default_exception::what() const {
|
char const * default_exception::what() const noexcept {
|
||||||
return m_msg.c_str();
|
return m_msg.c_str();
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ class z3_error : public z3_exception {
|
||||||
unsigned m_error_code;
|
unsigned m_error_code;
|
||||||
public:
|
public:
|
||||||
z3_error(unsigned error_code);
|
z3_error(unsigned error_code);
|
||||||
char const * what() const override;
|
char const * what() const noexcept override;
|
||||||
unsigned error_code() const override;
|
unsigned error_code() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -42,6 +42,6 @@ public:
|
||||||
struct fmt {};
|
struct fmt {};
|
||||||
default_exception(std::string && msg) : m_msg(std::move(msg)) {}
|
default_exception(std::string && msg) : m_msg(std::move(msg)) {}
|
||||||
default_exception(fmt, char const* msg, ...);
|
default_exception(fmt, char const* msg, ...);
|
||||||
char const * what() const override;
|
char const * what() const noexcept override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue