diff --git a/src/util/exception_utils.cpp b/src/util/exception_utils.cpp index afdf4ca5868..411cc3e23f1 100644 --- a/src/util/exception_utils.cpp +++ b/src/util/exception_utils.cpp @@ -86,3 +86,8 @@ std::string analysis_exceptiont::what() const { return reason; } + +std::string invalid_source_file_exceptiont::what() const +{ + return reason; +} diff --git a/src/util/exception_utils.h b/src/util/exception_utils.h index cb8e52d7c6e..0dcb74be6dd 100644 --- a/src/util/exception_utils.h +++ b/src/util/exception_utils.h @@ -120,4 +120,16 @@ class analysis_exceptiont : public cprover_exception_baset std::string reason; }; +/// Thrown when we can't handle something in an input source file. +/// For example, if we get C source code that is not syntactically valid +/// or that has type errors. +class invalid_source_file_exceptiont : public cprover_exception_baset +{ +public: + std::string what() const override; + +private: + std::string reason; +}; + #endif // CPROVER_UTIL_EXCEPTION_UTILS_H