xref: /freebsd/contrib/libcxxrt/stdexcept.cc (revision 13da1af1cd677b7901d3bf4b9dbe3290b94130d5)
194e3ee44SDavid Chisnall /*
294e3ee44SDavid Chisnall  * Copyright 2010-2011 PathScale, Inc. All rights reserved.
394e3ee44SDavid Chisnall  *
494e3ee44SDavid Chisnall  * Redistribution and use in source and binary forms, with or without
594e3ee44SDavid Chisnall  * modification, are permitted provided that the following conditions are met:
694e3ee44SDavid Chisnall  *
794e3ee44SDavid Chisnall  * 1. Redistributions of source code must retain the above copyright notice,
894e3ee44SDavid Chisnall  *    this list of conditions and the following disclaimer.
994e3ee44SDavid Chisnall  *
1094e3ee44SDavid Chisnall  * 2. Redistributions in binary form must reproduce the above copyright notice,
1194e3ee44SDavid Chisnall  *    this list of conditions and the following disclaimer in the documentation
1294e3ee44SDavid Chisnall  *    and/or other materials provided with the distribution.
1394e3ee44SDavid Chisnall  *
1494e3ee44SDavid Chisnall  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
1594e3ee44SDavid Chisnall  * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
1694e3ee44SDavid Chisnall  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1794e3ee44SDavid Chisnall  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
1894e3ee44SDavid Chisnall  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
1994e3ee44SDavid Chisnall  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
2094e3ee44SDavid Chisnall  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
2194e3ee44SDavid Chisnall  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
2294e3ee44SDavid Chisnall  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
2394e3ee44SDavid Chisnall  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
2494e3ee44SDavid Chisnall  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2594e3ee44SDavid Chisnall  */
2694e3ee44SDavid Chisnall 
277a984708SDavid Chisnall /**
287a984708SDavid Chisnall  * stdexcept.cc - provides stub implementations of the exceptions required by the runtime.
297a984708SDavid Chisnall  */
307a984708SDavid Chisnall #include "stdexcept.h"
317a984708SDavid Chisnall 
327a984708SDavid Chisnall namespace std {
337a984708SDavid Chisnall 
exception()34*13da1af1SEd Maste exception::exception() _LIBCXXRT_NOEXCEPT {}
~exception()357a984708SDavid Chisnall exception::~exception() {}
exception(const exception &)36*13da1af1SEd Maste exception::exception(const exception&) _LIBCXXRT_NOEXCEPT {}
operator =(const exception &)37*13da1af1SEd Maste exception& exception::operator=(const exception&) _LIBCXXRT_NOEXCEPT
387a984708SDavid Chisnall {
397a984708SDavid Chisnall 	return *this;
407a984708SDavid Chisnall }
what() const41*13da1af1SEd Maste const char* exception::what() const _LIBCXXRT_NOEXCEPT
427a984708SDavid Chisnall {
437a984708SDavid Chisnall 	return "std::exception";
447a984708SDavid Chisnall }
457a984708SDavid Chisnall 
bad_alloc()46*13da1af1SEd Maste bad_alloc::bad_alloc() _LIBCXXRT_NOEXCEPT {}
~bad_alloc()477a984708SDavid Chisnall bad_alloc::~bad_alloc() {}
bad_alloc(const bad_alloc &)48*13da1af1SEd Maste bad_alloc::bad_alloc(const bad_alloc&) _LIBCXXRT_NOEXCEPT {}
operator =(const bad_alloc &)49*13da1af1SEd Maste bad_alloc& bad_alloc::operator=(const bad_alloc&) _LIBCXXRT_NOEXCEPT
507a984708SDavid Chisnall {
517a984708SDavid Chisnall 	return *this;
527a984708SDavid Chisnall }
what() const53*13da1af1SEd Maste const char* bad_alloc::what() const _LIBCXXRT_NOEXCEPT
547a984708SDavid Chisnall {
557a984708SDavid Chisnall 	return "cxxrt::bad_alloc";
567a984708SDavid Chisnall }
577a984708SDavid Chisnall 
587a984708SDavid Chisnall 
597a984708SDavid Chisnall 
bad_cast()60*13da1af1SEd Maste bad_cast::bad_cast() _LIBCXXRT_NOEXCEPT {}
~bad_cast()617a984708SDavid Chisnall bad_cast::~bad_cast() {}
bad_cast(const bad_cast &)62*13da1af1SEd Maste bad_cast::bad_cast(const bad_cast&) _LIBCXXRT_NOEXCEPT {}
operator =(const bad_cast &)63*13da1af1SEd Maste bad_cast& bad_cast::operator=(const bad_cast&) _LIBCXXRT_NOEXCEPT
647a984708SDavid Chisnall {
657a984708SDavid Chisnall 	return *this;
667a984708SDavid Chisnall }
what() const67*13da1af1SEd Maste const char* bad_cast::what() const _LIBCXXRT_NOEXCEPT
687a984708SDavid Chisnall {
697a984708SDavid Chisnall 	return "std::bad_cast";
707a984708SDavid Chisnall }
717a984708SDavid Chisnall 
bad_typeid()72*13da1af1SEd Maste bad_typeid::bad_typeid() _LIBCXXRT_NOEXCEPT {}
~bad_typeid()737a984708SDavid Chisnall bad_typeid::~bad_typeid() {}
bad_typeid(const bad_typeid & __rhs)74*13da1af1SEd Maste bad_typeid::bad_typeid(const bad_typeid &__rhs) _LIBCXXRT_NOEXCEPT {}
operator =(const bad_typeid & __rhs)75*13da1af1SEd Maste bad_typeid& bad_typeid::operator=(const bad_typeid &__rhs) _LIBCXXRT_NOEXCEPT
767a984708SDavid Chisnall {
777a984708SDavid Chisnall 	return *this;
787a984708SDavid Chisnall }
797a984708SDavid Chisnall 
what() const80*13da1af1SEd Maste const char* bad_typeid::what() const _LIBCXXRT_NOEXCEPT
817a984708SDavid Chisnall {
827a984708SDavid Chisnall 	return "std::bad_typeid";
837a984708SDavid Chisnall }
847a984708SDavid Chisnall 
bad_array_new_length()85*13da1af1SEd Maste bad_array_new_length::bad_array_new_length() _LIBCXXRT_NOEXCEPT {}
~bad_array_new_length()86726f4cd5SBaptiste Daroussin bad_array_new_length::~bad_array_new_length() {}
bad_array_new_length(const bad_array_new_length &)87*13da1af1SEd Maste bad_array_new_length::bad_array_new_length(const bad_array_new_length&) _LIBCXXRT_NOEXCEPT {}
operator =(const bad_array_new_length &)88*13da1af1SEd Maste bad_array_new_length& bad_array_new_length::operator=(const bad_array_new_length&) _LIBCXXRT_NOEXCEPT
89726f4cd5SBaptiste Daroussin {
90726f4cd5SBaptiste Daroussin 	return *this;
91726f4cd5SBaptiste Daroussin }
92726f4cd5SBaptiste Daroussin 
what() const93*13da1af1SEd Maste const char* bad_array_new_length::what() const _LIBCXXRT_NOEXCEPT
941418fbd6SBaptiste Daroussin {
951418fbd6SBaptiste Daroussin 	return "std::bad_array_new_length";
961418fbd6SBaptiste Daroussin }
971418fbd6SBaptiste Daroussin 
987a984708SDavid Chisnall } // namespace std
997a984708SDavid Chisnall 
100