Skip to content

Commit 7905492

Browse files
author
Daniel Kroening
authored
Merge pull request #3137 from hannes-steffenhagen-diffblue/fix-virtual_destructor_for_cprover_exception_baset
Add a virtual destructor to cprover_exception_baset
2 parents be53e82 + 483f07c commit 7905492

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/util/exception_utils.h

+5
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,18 @@ Author: Fotis Koutoulakis, [email protected]
1616
/// Base class for exceptions thrown in the cprover project.
1717
/// Intended to be used as a convenient way to have a
1818
/// "catch all and report errors" from application entry points.
19+
/// Note that the reason we use a custom base class as opposed to
20+
/// std::exception or one of its derivates to avoid them being accidentally
21+
/// caught by code expecting standard exceptions to be only thrown by the
22+
/// standard library.
1923
class cprover_exception_baset
2024
{
2125
public:
2226
/// A human readable description of what went wrong.
2327
/// For readability, implementors should not add a leading
2428
/// or trailing newline to this description.
2529
virtual std::string what() const = 0;
30+
virtual ~cprover_exception_baset() = default;
2631
};
2732

2833
/// Thrown when users pass incorrect command line arguments,

0 commit comments

Comments
 (0)