1 // 2011-03-16 Benjamin Kosnik <bkoz@redhat.com>
3 // Copyright (C) 2011-2014 Free Software Foundation, Inc.
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with this library; see the file COPYING3. If not see
18 // <http://www.gnu.org/licenses/>.
22 #include <testsuite_hooks.h>
27 std::string
s("error");
34 catch(const exception
& e
)
44 catch(const exception
& e
)
51 invalid_argument
e3(s
);
54 catch(const exception
& e
)
64 catch(const exception
& e
)
74 catch(const exception
& e
)
84 catch(const exception
& e
)
94 catch(const exception
& e
)
101 overflow_error
e8(s
);
104 catch(const exception
& e
)
111 underflow_error
e9(s
);
114 catch(const exception
& e
)
120 template<typename _Tp
>
121 struct extra_error
: public _Tp
123 extra_error(const std::string
& s
) : _Tp(s
) { }
129 std::string
s("error");
133 extra_error
<logic_error
> e1(s
);
136 catch(const exception
& e
)
143 extra_error
<domain_error
> e2(s
);
146 catch(const exception
& e
)
153 extra_error
<invalid_argument
> e3(s
);
156 catch(const exception
& e
)
163 extra_error
<length_error
> e4(s
);
166 catch(const exception
& e
)
173 extra_error
<out_of_range
> e5(s
);
176 catch(const exception
& e
)
183 extra_error
<runtime_error
> e6(s
);
186 catch(const exception
& e
)
193 extra_error
<range_error
> e7(s
);
196 catch(const exception
& e
)
203 extra_error
<overflow_error
> e8(s
);
206 catch(const exception
& e
)
213 extra_error
<underflow_error
> e9(s
);
216 catch(const exception
& e
)