From 2452d78205601246f2fce0d4ab81da8d8c234e54 Mon Sep 17 00:00:00 2001 From: apio Date: Wed, 8 Jun 2022 17:39:42 +0200 Subject: [PATCH] throw_error is now [[ noreturn ]] --- src/Error.cpp | 4 ++-- src/Error.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Error.cpp b/src/Error.cpp index 034017d..9f57414 100644 --- a/src/Error.cpp +++ b/src/Error.cpp @@ -44,7 +44,7 @@ void Error::show_import_lines(const Location& loc, void(*import_line_printer)(co } } -void Error::throw_error(const Location& loc, const std::string line_text, const std::string& details) +[[noreturn]] void Error::throw_error(const Location& loc, const std::string line_text, const std::string& details) { show_import_lines(loc,show_import_line,std::cerr); @@ -77,7 +77,7 @@ void Error::throw_error(const Location& loc, const std::string line_text, const exit(1); } -void Error::throw_error_without_location(const std::string& details) +[[noreturn]] void Error::throw_error_without_location(const std::string& details) { std::cerr << "\033[1;1m"; diff --git a/src/Error.h b/src/Error.h index 0d65c78..5339312 100644 --- a/src/Error.h +++ b/src/Error.h @@ -5,9 +5,9 @@ namespace Error { void show_import_line(const Location& loc, std::ostream& output_stream); - void throw_error(const Location& loc, const std::string line_text, const std::string& details); + [[noreturn]] void throw_error(const Location& loc, const std::string line_text, const std::string& details); - void throw_error_without_location(const std::string& details); + [[noreturn]] void throw_error_without_location(const std::string& details); void throw_warning(const Location& loc, const std::string line_text, const std::string& details);