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