Dont let Diagnostic inherit from std::runtime_error

We are not using exceptions
This commit is contained in:
Sam Vervaeck 2024-01-21 01:12:02 +01:00
parent 25ccf60e02
commit 3979a9010b
Signed by: samvv
SSH key fingerprint: SHA256:dIg0ywU1OP+ZYifrYxy8c5esO72cIKB+4/9wkZj1VaY
2 changed files with 4 additions and 2 deletions

View file

@ -23,7 +23,7 @@ namespace bolt {
UnificationError,
};
class Diagnostic : std::runtime_error {
class Diagnostic {
const DiagnosticKind Kind;
@ -43,6 +43,8 @@ namespace bolt {
virtual unsigned getCode() const noexcept = 0;
virtual ~Diagnostic() {}
};
class UnexpectedStringDiagnostic : public Diagnostic {

View file

@ -39,7 +39,7 @@
namespace bolt {
Diagnostic::Diagnostic(DiagnosticKind Kind):
std::runtime_error("a compiler error occurred without being caught"), Kind(Kind) {}
Kind(Kind) {}
bool sourceLocLessThan(const Diagnostic* L, const Diagnostic* R) {
auto N1 = L->getNode();