Lines Matching full:exception

1 // RUN: %check_clang_tidy %s hicpp-exception-baseclass %t -- -- -fcxx-exceptions
4 class exception {}; class
5 class invalid_argument : public exception {};
8 class derived_exception : public std::exception {};
16 class bad_inheritance : private std::exception {};
17 class no_good_inheritance : protected std::exception {};
18 class really_creative : public non_derived_exception, private std::exception {};
24 …-NOTES: [[@LINE-1]]:11: warning: throwing an exception whose type 'int' is not derived from 'std:: in problematic()
28 …K-NOTES: [[@LINE-1]]:9: warning: throwing an exception whose type 'int' is not derived from 'std:: in problematic()
32 …-NOTES: [[@LINE-1]]:11: warning: throwing an exception whose type 'int' is not derived from 'std:: in problematic()
34 …/ Ok, even if the type is not known, conforming code can never rethrow a non-std::exception object. in problematic()
39 …[@LINE-1]]:11: warning: throwing an exception whose type 'non_derived_exception' is not derived fr… in problematic()
44 …[[@LINE-1]]:9: warning: throwing an exception whose type 'non_derived_exception' is not derived fr… in problematic()
53 …: [[@LINE-1]]:11: warning: throwing an exception whose type 'bad_inheritance' is not derived from … in problematic()
56 …[[@LINE-1]]:11: warning: throwing an exception whose type 'no_good_inheritance' is not derived fro… in problematic()
59 …: [[@LINE-1]]:11: warning: throwing an exception whose type 'really_creative' is not derived from … in problematic()
64 …S: [[@LINE-1]]:9: warning: throwing an exception whose type 'bad_inheritance' is not derived from … in problematic()
67 … [[@LINE-1]]:9: warning: throwing an exception whose type 'no_good_inheritance' is not derived fro… in problematic()
70 …S: [[@LINE-1]]:9: warning: throwing an exception whose type 'really_creative' is not derived from … in problematic()
77 throw std::exception(); // Ok in allowed_throws()
78 } catch (std::exception &e) { // Ok in allowed_throws()
80 throw std::exception(); in allowed_throws()
96 } catch (std::exception &e) { // Can be caught as std::exception, even with multiple inheritance in allowed_throws()
103 …-NOTES: [[@LINE-1]]:33: warning: throwing an exception whose type 'int' is not derived from 'std:: in test_lambdas()
107 // Templated function that throws exception based on template type
110 …LINE-1]]:31: warning: throwing an exception whose type 'bad_generic_exception<int>' is not derived…
114 …]]:31: warning: throwing an exception whose type 'bad_generic_exception<std::exception>' is not de…
115 // CHECK-NOTES: [[@LINE-6]]:31: note: type 'bad_generic_exception<std::exception>' is a template in…
118 …]:31: warning: throwing an exception whose type 'exotic_exception<non_derived_exception>' is not d…
122 …NOTES: [[@LINE-13]]:31: warning: throwing an exception whose type 'int' is not derived from 'std::
125 …@LINE-16]]:31: warning: throwing an exception whose type 'non_derived_exception' is not derived fr…
131 #define THROW_GOOD_EXCEPTION throw std::exception();
135 class generic_exception : std::exception {};
146 THROW_EXCEPTION(std::exception); // Ok in generic_exceptions()
151 …K-NOTES: [[@LINE-1]]:3: warning: throwing an exception whose type 'int' is not derived from 'std:: in generic_exceptions()
160 …@LINE-1]]:9: warning: throwing an exception whose type 'bad_generic_exception<int>' is not derived… in generic_exceptions()
162 throw bad_generic_exception<std::exception>(); in generic_exceptions()
163 …1]]:9: warning: throwing an exception whose type 'bad_generic_exception<std::exception>' is not de… in generic_exceptions()
166 THROW_EXCEPTION(bad_generic_exception<std::exception>); in generic_exceptions()
169 …]]:9: warning: throwing an exception whose type 'exotic_exception<non_derived_exception>' is not d… in generic_exceptions()
177 // Test for typedefed exception types
185 …[@LINE-1]]:9: warning: throwing an exception whose type 'TypedefedBad' (aka 'int') is not derived … in typedefed()
190 … [[@LINE-1]]:9: warning: throwing an exception whose type 'UsingBad' (aka 'int') is not derived fr… in typedefed()
206 …K-NOTES: [[@LINE-1]]:9: warning: throwing an exception whose type 'int' is not derived from 'std:: in templated_thrower()
212 …K-NOTES: [[@LINE-1]]:9: warning: throwing an exception whose type 'int' is not derived from 'std:: in templated_thrower2()
224 …K-NOTES: [[@LINE-1]]:9: warning: throwing an exception whose type 'int' is not derived from 'std:: in exception_created_with_function()
239 …K-NOTES: [[@LINE-1]]:9: warning: throwing an exception whose type 'int' is not derived from 'std:: in templated_factory()
244 …K-NOTES: [[@LINE-1]]:9: warning: throwing an exception whose type 'int' is not derived from 'std:: in templated_factory2()
256 …K-NOTES: [[@LINE-1]]:9: warning: throwing an exception whose type 'int' is not derived from 'std:: in exception_from_factory()
263 …K-NOTES: [[@LINE-1]]:9: warning: throwing an exception whose type 'int' is not derived from 'std:: in exception_from_factory()
269 …-NOTES: [[@LINE-1]]:37: warning: throwing an exception whose type 'int' is not derived from 'std::
276 …-NOTES: [[@LINE-1]]:32: warning: throwing an exception whose type 'int' is not derived from 'std::