1 .. title:: clang-tidy - hicpp-exception-baseclass
3 hicpp-exception-baseclass
4 =========================
6 Ensure that every value that in a ``throw`` expression is an instance of
9 This enforces `rule 15.1 <http://www.codingstandard.com/section/15-1-throwing-an-exception/>`_
10 of the High Integrity C++ Coding Standard.
14 class custom_exception {};
16 void throwing() noexcept(false) {
17 // Problematic throw expressions.
19 throw custom_exception();
22 class mathematical_error : public std::exception {};
24 void throwing2() noexcept(false) {
25 // These kind of throws are ok.
26 throw mathematical_error();
27 throw std::runtime_error();
28 throw std::exception();