diff --git a/src/ParsingDriver.hh b/src/ParsingDriver.hh
index 0c4fe58c4c50b1b3f0752897169b9c4051996888..a8fba462f147f11f9c30aeb751e923849ef33cee 100644
--- a/src/ParsingDriver.hh
+++ b/src/ParsingDriver.hh
@@ -314,9 +314,9 @@ public:
   expr_t var_expectation_model_discount {nullptr};
 
   //! Error handler with explicit location
-  void error(const Dynare::parser::location_type& l, const string& m) __attribute__((noreturn));
+  [[noreturn]] void error(const Dynare::parser::location_type& l, const string& m);
   //! Error handler using saved location
-  void error(const string& m) __attribute__((noreturn));
+  [[noreturn]] void error(const string& m);
   //! Warning handler using saved location
   void warning(const string& m);