xref: /dflybsd-src/contrib/gcc-8.0/libstdc++-v3/include/bits/functexcept.h (revision 38fd149817dfbff97799f62fcb70be98c4e32523)
1*38fd1498Szrj // Function-Based Exception Support -*- C++ -*-
2*38fd1498Szrj 
3*38fd1498Szrj // Copyright (C) 2001-2018 Free Software Foundation, Inc.
4*38fd1498Szrj //
5*38fd1498Szrj // This file is part of the GNU ISO C++ Library.  This library is free
6*38fd1498Szrj // software; you can redistribute it and/or modify it under the
7*38fd1498Szrj // terms of the GNU General Public License as published by the
8*38fd1498Szrj // Free Software Foundation; either version 3, or (at your option)
9*38fd1498Szrj // any later version.
10*38fd1498Szrj 
11*38fd1498Szrj // This library is distributed in the hope that it will be useful,
12*38fd1498Szrj // but WITHOUT ANY WARRANTY; without even the implied warranty of
13*38fd1498Szrj // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14*38fd1498Szrj // GNU General Public License for more details.
15*38fd1498Szrj 
16*38fd1498Szrj // Under Section 7 of GPL version 3, you are granted additional
17*38fd1498Szrj // permissions described in the GCC Runtime Library Exception, version
18*38fd1498Szrj // 3.1, as published by the Free Software Foundation.
19*38fd1498Szrj 
20*38fd1498Szrj // You should have received a copy of the GNU General Public License and
21*38fd1498Szrj // a copy of the GCC Runtime Library Exception along with this program;
22*38fd1498Szrj // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
23*38fd1498Szrj // <http://www.gnu.org/licenses/>.
24*38fd1498Szrj 
25*38fd1498Szrj /** @file bits/functexcept.h
26*38fd1498Szrj  *  This is an internal header file, included by other library headers.
27*38fd1498Szrj  *  Do not attempt to use it directly. @headername{exception}
28*38fd1498Szrj  *
29*38fd1498Szrj  *  This header provides support for -fno-exceptions.
30*38fd1498Szrj  */
31*38fd1498Szrj 
32*38fd1498Szrj //
33*38fd1498Szrj // ISO C++ 14882: 19.1  Exception classes
34*38fd1498Szrj //
35*38fd1498Szrj 
36*38fd1498Szrj #ifndef _FUNCTEXCEPT_H
37*38fd1498Szrj #define _FUNCTEXCEPT_H 1
38*38fd1498Szrj 
39*38fd1498Szrj #include <bits/c++config.h>
40*38fd1498Szrj #include <bits/exception_defines.h>
41*38fd1498Szrj 
_GLIBCXX_VISIBILITY(default)42*38fd1498Szrj namespace std _GLIBCXX_VISIBILITY(default)
43*38fd1498Szrj {
44*38fd1498Szrj _GLIBCXX_BEGIN_NAMESPACE_VERSION
45*38fd1498Szrj 
46*38fd1498Szrj   // Helper for exception objects in <except>
47*38fd1498Szrj   void
48*38fd1498Szrj   __throw_bad_exception(void) __attribute__((__noreturn__));
49*38fd1498Szrj 
50*38fd1498Szrj   // Helper for exception objects in <new>
51*38fd1498Szrj   void
52*38fd1498Szrj   __throw_bad_alloc(void) __attribute__((__noreturn__));
53*38fd1498Szrj 
54*38fd1498Szrj   // Helper for exception objects in <typeinfo>
55*38fd1498Szrj   void
56*38fd1498Szrj   __throw_bad_cast(void) __attribute__((__noreturn__));
57*38fd1498Szrj 
58*38fd1498Szrj   void
59*38fd1498Szrj   __throw_bad_typeid(void) __attribute__((__noreturn__));
60*38fd1498Szrj 
61*38fd1498Szrj   // Helpers for exception objects in <stdexcept>
62*38fd1498Szrj   void
63*38fd1498Szrj   __throw_logic_error(const char*) __attribute__((__noreturn__));
64*38fd1498Szrj 
65*38fd1498Szrj   void
66*38fd1498Szrj   __throw_domain_error(const char*) __attribute__((__noreturn__));
67*38fd1498Szrj 
68*38fd1498Szrj   void
69*38fd1498Szrj   __throw_invalid_argument(const char*) __attribute__((__noreturn__));
70*38fd1498Szrj 
71*38fd1498Szrj   void
72*38fd1498Szrj   __throw_length_error(const char*) __attribute__((__noreturn__));
73*38fd1498Szrj 
74*38fd1498Szrj   void
75*38fd1498Szrj   __throw_out_of_range(const char*) __attribute__((__noreturn__));
76*38fd1498Szrj 
77*38fd1498Szrj   void
78*38fd1498Szrj   __throw_out_of_range_fmt(const char*, ...) __attribute__((__noreturn__))
79*38fd1498Szrj     __attribute__((__format__(__gnu_printf__, 1, 2)));
80*38fd1498Szrj 
81*38fd1498Szrj   void
82*38fd1498Szrj   __throw_runtime_error(const char*) __attribute__((__noreturn__));
83*38fd1498Szrj 
84*38fd1498Szrj   void
85*38fd1498Szrj   __throw_range_error(const char*) __attribute__((__noreturn__));
86*38fd1498Szrj 
87*38fd1498Szrj   void
88*38fd1498Szrj   __throw_overflow_error(const char*) __attribute__((__noreturn__));
89*38fd1498Szrj 
90*38fd1498Szrj   void
91*38fd1498Szrj   __throw_underflow_error(const char*) __attribute__((__noreturn__));
92*38fd1498Szrj 
93*38fd1498Szrj   // Helpers for exception objects in <ios>
94*38fd1498Szrj   void
95*38fd1498Szrj   __throw_ios_failure(const char*) __attribute__((__noreturn__));
96*38fd1498Szrj 
97*38fd1498Szrj   void
98*38fd1498Szrj   __throw_system_error(int) __attribute__((__noreturn__));
99*38fd1498Szrj 
100*38fd1498Szrj   void
101*38fd1498Szrj   __throw_future_error(int) __attribute__((__noreturn__));
102*38fd1498Szrj 
103*38fd1498Szrj   // Helpers for exception objects in <functional>
104*38fd1498Szrj   void
105*38fd1498Szrj   __throw_bad_function_call() __attribute__((__noreturn__));
106*38fd1498Szrj 
107*38fd1498Szrj _GLIBCXX_END_NAMESPACE_VERSION
108*38fd1498Szrj } // namespace
109*38fd1498Szrj 
110*38fd1498Szrj #endif
111