functexcept.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. // Function-Based Exception Support -*- C++ -*-
  2. // Copyright (C) 2001, 2004, 2005, 2008, 2009 Free Software Foundation, Inc.
  3. //
  4. // This file is part of the GNU ISO C++ Library. This library is free
  5. // software; you can redistribute it and/or modify it under the
  6. // terms of the GNU General Public License as published by the
  7. // Free Software Foundation; either version 3, or (at your option)
  8. // any later version.
  9. // This library is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. // Under Section 7 of GPL version 3, you are granted additional
  14. // permissions described in the GCC Runtime Library Exception, version
  15. // 3.1, as published by the Free Software Foundation.
  16. // You should have received a copy of the GNU General Public License and
  17. // a copy of the GCC Runtime Library Exception along with this program;
  18. // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  19. // <http://www.gnu.org/licenses/>.
  20. /** @file functexcept.h
  21. * This header provides support for -fno-exceptions.
  22. */
  23. //
  24. // ISO C++ 14882: 19.1 Exception classes
  25. //
  26. #ifndef _FUNCTEXCEPT_H
  27. #define _FUNCTEXCEPT_H 1
  28. #include <bits/c++config.h>
  29. #include <exception_defines.h>
  30. _GLIBCXX_BEGIN_NAMESPACE(std)
  31. // Helper for exception objects in <except>
  32. void
  33. __throw_bad_exception(void) __attribute__((__noreturn__));
  34. // Helper for exception objects in <new>
  35. void
  36. __throw_bad_alloc(void) __attribute__((__noreturn__));
  37. // Helper for exception objects in <typeinfo>
  38. void
  39. __throw_bad_cast(void) __attribute__((__noreturn__));
  40. void
  41. __throw_bad_typeid(void) __attribute__((__noreturn__));
  42. // Helpers for exception objects in <stdexcept>
  43. void
  44. __throw_logic_error(const char*) __attribute__((__noreturn__));
  45. void
  46. __throw_domain_error(const char*) __attribute__((__noreturn__));
  47. void
  48. __throw_invalid_argument(const char*) __attribute__((__noreturn__));
  49. void
  50. __throw_length_error(const char*) __attribute__((__noreturn__));
  51. void
  52. __throw_out_of_range(const char*) __attribute__((__noreturn__));
  53. void
  54. __throw_runtime_error(const char*) __attribute__((__noreturn__));
  55. void
  56. __throw_range_error(const char*) __attribute__((__noreturn__));
  57. void
  58. __throw_overflow_error(const char*) __attribute__((__noreturn__));
  59. void
  60. __throw_underflow_error(const char*) __attribute__((__noreturn__));
  61. // Helpers for exception objects in <ios>
  62. void
  63. __throw_ios_failure(const char*) __attribute__((__noreturn__));
  64. void
  65. __throw_system_error(int) __attribute__((__noreturn__));
  66. _GLIBCXX_END_NAMESPACE
  67. #endif