106c3fb27SDimitry Andric //===----------------------------------------------------------------------===//
206c3fb27SDimitry Andric //
306c3fb27SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
406c3fb27SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
506c3fb27SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
606c3fb27SDimitry Andric //
706c3fb27SDimitry Andric //===----------------------------------------------------------------------===//
806c3fb27SDimitry Andric 
9*5f757f3fSDimitry Andric #include <__verbose_abort>
1006c3fb27SDimitry Andric #include <new>
1106c3fb27SDimitry Andric 
1206c3fb27SDimitry Andric namespace std { // purposefully not versioned
1306c3fb27SDimitry Andric 
1406c3fb27SDimitry Andric #ifndef __GLIBCXX__
1506c3fb27SDimitry Andric const nothrow_t nothrow{};
1606c3fb27SDimitry Andric #endif
1706c3fb27SDimitry Andric 
1806c3fb27SDimitry Andric #ifndef LIBSTDCXX
1906c3fb27SDimitry Andric 
__throw_bad_alloc()2006c3fb27SDimitry Andric void __throw_bad_alloc() {
2106c3fb27SDimitry Andric #  ifndef _LIBCPP_HAS_NO_EXCEPTIONS
2206c3fb27SDimitry Andric   throw bad_alloc();
2306c3fb27SDimitry Andric #  else
24*5f757f3fSDimitry Andric   _LIBCPP_VERBOSE_ABORT("bad_alloc was thrown in -fno-exceptions mode");
2506c3fb27SDimitry Andric #  endif
2606c3fb27SDimitry Andric }
2706c3fb27SDimitry Andric 
2806c3fb27SDimitry Andric #endif // !LIBSTDCXX
2906c3fb27SDimitry Andric 
3006c3fb27SDimitry Andric } // namespace std
31