Skip to content

Commit 8b965fe

Browse files
committed
Removed exception specification from custom operator new overrides.
This should hopefully fix segfaults on OpenBSD in CI, when these operators throw bad_alloc. Presumably, clang on OpenBSD crashes the process if an exception is thrown from a function with an exception specification, even if the exception matches the specification. The specifications are not necessary since C++11 anyway, and we no longer support C++03.
1 parent 360ecfb commit 8b965fe

3 files changed

Lines changed: 3 additions & 15 deletions

File tree

test/threads/thread/constr/FArgs_pass.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,8 @@ unsigned throw_one = 0xFFFF;
2929

3030
#if defined _GLIBCXX_THROW
3131
void* operator new(std::size_t s) _GLIBCXX_THROW (std::bad_alloc)
32-
#elif defined BOOST_MSVC
33-
void* operator new(std::size_t s)
34-
#elif __cplusplus > 201402L
35-
void* operator new(std::size_t s)
3632
#else
37-
void* operator new(std::size_t s) throw (std::bad_alloc)
33+
void* operator new(std::size_t s)
3834
#endif
3935
{
4036
//std::cout << __FILE__ << ":" << __LINE__ << std::endl;

test/threads/thread/constr/F_pass.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,8 @@ unsigned throw_one = 0xFFFF;
2929

3030
#if defined _GLIBCXX_THROW
3131
void* operator new(std::size_t s) _GLIBCXX_THROW (std::bad_alloc)
32-
#elif defined BOOST_MSVC
33-
void* operator new(std::size_t s)
34-
#elif __cplusplus > 201402L
35-
void* operator new(std::size_t s)
3632
#else
37-
void* operator new(std::size_t s) throw (std::bad_alloc)
33+
void* operator new(std::size_t s)
3834
#endif
3935
{
4036
//std::cout << __FILE__ << ":" << __LINE__ << std::endl;

test/threads/thread/constr/lambda_pass.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,8 @@ unsigned throw_one = 0xFFFF;
3131

3232
#if defined _GLIBCXX_THROW
3333
void* operator new(std::size_t s) _GLIBCXX_THROW (std::bad_alloc)
34-
#elif defined BOOST_MSVC
35-
void* operator new(std::size_t s)
36-
#elif __cplusplus > 201402L
37-
void* operator new(std::size_t s)
3834
#else
39-
void* operator new(std::size_t s) throw (std::bad_alloc)
35+
void* operator new(std::size_t s)
4036
#endif
4137
{
4238
if (throw_one == 0) throw std::bad_alloc();

0 commit comments

Comments
 (0)