forked from OSchip/llvm-project
Add [[noreturn]] attribute to throw_bad_alloc_helper().
llvm-svn: 273819
This commit is contained in:
parent
95b5ac7df9
commit
3740071be0
|
@ -16,14 +16,13 @@
|
||||||
|
|
||||||
#include "test_macros.h"
|
#include "test_macros.h"
|
||||||
|
|
||||||
#if TEST_HAS_FEATURE(address_sanitizer) \
|
#if defined(TEST_HAS_SANITIZERS)
|
||||||
|| TEST_HAS_FEATURE(memory_sanitizer) \
|
|
||||||
|| TEST_HAS_FEATURE(thread_sanitizer)
|
|
||||||
#define DISABLE_NEW_COUNT
|
#define DISABLE_NEW_COUNT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
|
TEST_NORETURN
|
||||||
inline void throw_bad_alloc_helper() {
|
inline void throw_bad_alloc_helper() {
|
||||||
#ifndef TEST_HAS_NO_EXCEPTIONS
|
#ifndef TEST_HAS_NO_EXCEPTIONS
|
||||||
throw std::bad_alloc();
|
throw std::bad_alloc();
|
||||||
|
|
|
@ -86,6 +86,12 @@
|
||||||
#define TEST_HAS_SANITIZERS
|
#define TEST_HAS_SANITIZERS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(_LIBCPP_NORETURN)
|
||||||
|
#define TEST_NORETURN _LIBCPP_NORETURN
|
||||||
|
#else
|
||||||
|
#define TEST_NORETURN [[noreturn]]
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Macros for testing libc++ specific behavior and extensions */
|
/* Macros for testing libc++ specific behavior and extensions */
|
||||||
#if defined(_LIBCPP_VERSION)
|
#if defined(_LIBCPP_VERSION)
|
||||||
#define LIBCPP_ASSERT(...) assert(__VA_ARGS__)
|
#define LIBCPP_ASSERT(...) assert(__VA_ARGS__)
|
||||||
|
|
Loading…
Reference in New Issue