diff --git a/include/bolt/DiagnosticEngine.hpp b/include/bolt/DiagnosticEngine.hpp index 449f1ca17..7276f91a2 100644 --- a/include/bolt/DiagnosticEngine.hpp +++ b/include/bolt/DiagnosticEngine.hpp @@ -17,12 +17,20 @@ namespace bolt { class Node; class DiagnosticEngine { + + bool HasError = false; + public: + inline bool hasError() const noexcept { + return HasError; + } + virtual void addDiagnostic(Diagnostic* Diagnostic) = 0; template void add(Ts&&... Args) { + HasError = true; addDiagnostic(new D { std::forward(Args)... }); }