diff --git a/include/sol/optional_implementation.hpp b/include/sol/optional_implementation.hpp index 754e2731f..4bb72d6ac 100644 --- a/include/sol/optional_implementation.hpp +++ b/include/sol/optional_implementation.hpp @@ -657,7 +657,7 @@ namespace sol { class bad_optional_access : public std::exception { public: bad_optional_access() = default; - const char* what() const noexcept { + const char* what() const noexcept override { return "Optional has no value"; } }; diff --git a/single/include/sol/sol.hpp b/single/include/sol/sol.hpp index 9de932755..75e4cc5bf 100644 --- a/single/include/sol/sol.hpp +++ b/single/include/sol/sol.hpp @@ -4631,7 +4631,7 @@ namespace sol { class bad_optional_access : public std::exception { public: bad_optional_access() = default; - const char* what() const noexcept { + const char* what() const noexcept override { return "Optional has no value"; } };