diff --git a/include/tables/TableKeyNotDefinedException.h b/include/tables/TableKeyNotDefinedException.h index 2ff4cf9dc1..a99ba9409f 100644 --- a/include/tables/TableKeyNotDefinedException.h +++ b/include/tables/TableKeyNotDefinedException.h @@ -21,7 +21,7 @@ class TableKeyNotDefinedException : public std::exception { */ TableKeyNotDefinedException(llvm::StringRef key); ~TableKeyNotDefinedException() noexcept; - const char* what(); + const char* what() const noexcept override; private: std::string msg; diff --git a/src/tables/TableKeyNotDefinedException.cpp b/src/tables/TableKeyNotDefinedException.cpp index 3fef63872d..31eb8b346d 100644 --- a/src/tables/TableKeyNotDefinedException.cpp +++ b/src/tables/TableKeyNotDefinedException.cpp @@ -12,6 +12,8 @@ TableKeyNotDefinedException::TableKeyNotDefinedException(llvm::StringRef key) msg += key; } -const char* TableKeyNotDefinedException::what() { return msg.c_str(); } +const char* TableKeyNotDefinedException::what() const noexcept { + return msg.c_str(); +} TableKeyNotDefinedException::~TableKeyNotDefinedException() noexcept {}