1 // Tests that the exceptions declared by the TM TS (N4514) as transaction_safe
2 // are indeed that. Thus, this also tests the transactional clones in
3 // libstdc++ and libsupc++.
14 template<typename T> void thrower(const T& t)
25 if (ex != t) abort ();
29 template<typename T> void thrower1(const string& what)
40 if (what != ex.what()) abort ();
44 template<typename T> void thrower2(const string& what)
55 if (what != ex.what()) abort ();
62 thrower<unsigned int> (23);
64 thrower<unsigned short> (23);
66 thrower<unsigned char> (23);
68 thrower<unsigned long int> (42);
69 thrower<long int> (42);
70 thrower<unsigned long long int> (42);
71 thrower<long long int> (42);
72 thrower<double> (23.42);
73 thrower<long double> (23.42);
74 thrower<float> (23.42);
77 thrower1<exception> ("std::exception");
78 thrower1<bad_exception> ("std::bad_exception");
79 thrower2<logic_error> ("test");
80 thrower2<domain_error> ("test");
81 thrower2<invalid_argument> ("test");
82 thrower2<length_error> ("test");
83 thrower2<out_of_range> ("test");
84 thrower2<runtime_error> ("test");
85 thrower2<range_error> ("test");
86 thrower2<overflow_error> ("test");
87 thrower2<underflow_error> ("test");