diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1e3af147..554346f4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -98,6 +98,7 @@ set(IMPL_HEADERS ${SOURCES_DIR}/internal/catch_jsonwriter.hpp ${SOURCES_DIR}/internal/catch_lazy_expr.hpp ${SOURCES_DIR}/internal/catch_leak_detector.hpp + ${SOURCES_DIR}/internal/catch_lifetimebound.hpp ${SOURCES_DIR}/internal/catch_list.hpp ${SOURCES_DIR}/internal/catch_logical_traits.hpp ${SOURCES_DIR}/internal/catch_message_info.hpp diff --git a/src/catch2/catch_all.hpp b/src/catch2/catch_all.hpp index 2417d856..3dc4609e 100644 --- a/src/catch2/catch_all.hpp +++ b/src/catch2/catch_all.hpp @@ -79,6 +79,7 @@ #include #include #include +#include #include #include #include diff --git a/src/catch2/internal/catch_lifetimebound.hpp b/src/catch2/internal/catch_lifetimebound.hpp new file mode 100644 index 00000000..8114dc70 --- /dev/null +++ b/src/catch2/internal/catch_lifetimebound.hpp @@ -0,0 +1,24 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 + +#ifndef CATCH_LIFETIMEBOUND_HPP_INCLUDED +#define CATCH_LIFETIMEBOUND_HPP_INCLUDED + +#if !defined( __has_cpp_attribute ) +# define CATCH_ATTR_LIFETIMEBOUND +#elif __has_cpp_attribute( msvc::lifetimebound ) +# define CATCH_ATTR_LIFETIMEBOUND [[msvc::lifetimebound]] +#elif __has_cpp_attribute( clang::lifetimebound ) +# define CATCH_ATTR_LIFETIMEBOUND [[clang::lifetimebound]] +#elif __has_cpp_attribute( lifetimebound ) +# define CATCH_ATTR_LIFETIMEBOUND [[lifetimebound]] +#else +# define CATCH_ATTR_LIFETIMEBOUND +#endif + +#endif // CATCH_LIFETIMEBOUND_HPP_INCLUDED diff --git a/src/catch2/meson.build b/src/catch2/meson.build index 60f7777a..273e330f 100644 --- a/src/catch2/meson.build +++ b/src/catch2/meson.build @@ -105,6 +105,7 @@ internal_headers = [ 'internal/catch_jsonwriter.hpp', 'internal/catch_lazy_expr.hpp', 'internal/catch_leak_detector.hpp', + 'internal/catch_lifetimebound.hpp', 'internal/catch_list.hpp', 'internal/catch_logical_traits.hpp', 'internal/catch_message_info.hpp',