Dont let Diagnostic
inherit from std::runtime_error
We are not using exceptions
This commit is contained in:
parent
25ccf60e02
commit
3979a9010b
2 changed files with 4 additions and 2 deletions
|
@ -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 {
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue