minix/external/bsd/libc++/dist/libcxx/src/stdexcept.cpp
Lionel Sambuc 0a6a1f1d05 NetBSD re-synchronization of the source tree
This brings our tree to NetBSD 7.0, as found on -current on the
10-10-2015.

This updates:
 - LLVM to 3.6.1
 - GCC to GCC 5.1
 - Replace minix/commands/zdump with usr.bin/zdump
 - external/bsd/libelf has moved to /external/bsd/elftoolchain/
 - Import ctwm
 - Drop sprintf from libminc

Change-Id: I149836ac18e9326be9353958bab9b266efb056f0
2016-01-13 20:32:14 +01:00

107 lines
2.1 KiB
C++

//===------------------------ stdexcept.cpp -------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "__refstring"
#include "stdexcept"
#include "new"
#include "string"
#include "system_error"
#ifndef __has_include
#define __has_include(inc) 0
#endif
/* For _LIBCPPABI_VERSION */
#if __has_include(<cxxabi.h>) || defined(__APPLE_) || defined(LIBCXXRT)
#include <cxxabi.h>
#endif
static_assert(sizeof(std::__libcpp_refstring) == sizeof(const char *), "");
namespace std // purposefully not using versioning namespace
{
logic_error::logic_error(const string& msg) : __imp_(msg.c_str())
{
}
logic_error::logic_error(const char* msg) : __imp_(msg)
{
}
logic_error::logic_error(const logic_error& le) _NOEXCEPT : __imp_(le.__imp_)
{
}
logic_error&
logic_error::operator=(const logic_error& le) _NOEXCEPT
{
__imp_ = le.__imp_;
return *this;
}
#if !defined(_LIBCPPABI_VERSION) && !defined(LIBSTDCXX)
logic_error::~logic_error() _NOEXCEPT
{
}
const char*
logic_error::what() const _NOEXCEPT
{
return __imp_.c_str();
}
#endif
runtime_error::runtime_error(const string& msg) : __imp_(msg.c_str())
{
}
runtime_error::runtime_error(const char* msg) : __imp_(msg)
{
}
runtime_error::runtime_error(const runtime_error& le) _NOEXCEPT
: __imp_(le.__imp_)
{
}
runtime_error&
runtime_error::operator=(const runtime_error& le) _NOEXCEPT
{
__imp_ = le.__imp_;
return *this;
}
#if !defined(_LIBCPPABI_VERSION) && !defined(LIBSTDCXX)
runtime_error::~runtime_error() _NOEXCEPT
{
}
const char*
runtime_error::what() const _NOEXCEPT
{
return __imp_.c_str();
}
domain_error::~domain_error() _NOEXCEPT {}
invalid_argument::~invalid_argument() _NOEXCEPT {}
length_error::~length_error() _NOEXCEPT {}
out_of_range::~out_of_range() _NOEXCEPT {}
range_error::~range_error() _NOEXCEPT {}
overflow_error::~overflow_error() _NOEXCEPT {}
underflow_error::~underflow_error() _NOEXCEPT {}
#endif
} // std