The <new> and <exception> headers each include each other, which makes
building them as header-units "exciting". The <new> header only needs
the definition of std::exception (in order to derive from it) which is
already in its own header, so just include that.
libstdc++-v3/ChangeLog:
* include/bits/stl_iterator.h: Include <bits/exception_defines.h>
for definitions of __try, __catch and __throw_exception_again.
(counted_iterator::operator++(int)): Use __throw_exception_again
instead of throw.
* libsupc++/new: Include <bits/exception.h> not <exception>.
* libsupc++/new_opvnt.cc: Include <bits/exception_defines.h>.
* testsuite/18_support/destroying_delete.cc: Include
<type_traits> for std::is_same_v definition.
* testsuite/20_util/variant/index_type.cc: Qualify size_t.
#if __cplusplus > 201703L
# include <compare>
# include <new>
+# include <bits/exception_defines.h>
# include <bits/iterator_concepts.h>
#endif
return _M_current++;
} __catch(...) {
++_M_length;
- throw;
+ __throw_exception_again;
}
}
#pragma GCC system_header
#include <bits/c++config.h>
-#include <exception>
+#include <bits/exception.h>
#pragma GCC visibility push(default)
*
* @c bad_alloc (or classes derived from it) is used to report allocation
* errors from the throwing forms of @c new. */
- class bad_alloc : public exception
+ class bad_alloc : public exception
{
public:
bad_alloc() throw() { }
#include <bits/c++config.h>
#include "new"
-
+#include "exception_defines.h"
+
_GLIBCXX_WEAK_DEFINITION void*
operator new[] (std::size_t sz, const std::nothrow_t&) noexcept
{
// { dg-do run { target c++2a } }
#include <new>
+#include <type_traits>
#include <testsuite_hooks.h>
#ifndef __cpp_lib_destroying_delete
#include <variant>
static_assert(sizeof(std::variant<signed char, unsigned char>)
- < sizeof(size_t));
+ < sizeof(std::size_t));