From 6146a104b875aad1fd36e7f3aad02e93ca2d2d0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Fri, 27 Dec 2024 23:46:25 +0100 Subject: [PATCH] WIP: unreachable? --- src/catch2/internal/catch_unreachable.cpp | 17 +++++++++++++++++ src/catch2/internal/catch_unreachable.hpp | 21 +++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 src/catch2/internal/catch_unreachable.cpp create mode 100644 src/catch2/internal/catch_unreachable.hpp diff --git a/src/catch2/internal/catch_unreachable.cpp b/src/catch2/internal/catch_unreachable.cpp new file mode 100644 index 00000000..9f3af49e --- /dev/null +++ b/src/catch2/internal/catch_unreachable.cpp @@ -0,0 +1,17 @@ + +// 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 + +#include + +namespace Catch { + namespace Detail { + + void unreachable(){} + + } +} // end namespace Catch diff --git a/src/catch2/internal/catch_unreachable.hpp b/src/catch2/internal/catch_unreachable.hpp new file mode 100644 index 00000000..297b8d6d --- /dev/null +++ b/src/catch2/internal/catch_unreachable.hpp @@ -0,0 +1,21 @@ + +// 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_UNREACHABLE_HPP_INCLUDED +#define CATCH_UNREACHABLE_HPP_INCLUDED + +namespace Catch { + + namespace Detail { + // TODO: explain + [[noreturn]] void unreachable(); + + } + +} // end namespace Catch + +#endif // CATCH_UNREACHABLE_HPP_INCLUDED