Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
deprecated.hpp
Go to the documentation of this file.
1// Copyright 2024, Toyota Motor Corporation
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
5#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_COMPILER_SUPPORT_ATTRIBUTES_DEPRECATED_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_COMPILER_SUPPORT_ATTRIBUTES_DEPRECATED_HPP_
7
8// IWYU pragma: private, include "arene/base/compiler_support/attributes.hpp"
9
10#include "arene/base/compiler_support/attributes/has_attribute.hpp"
11
12// NOLINTBEGIN(cppcoreguidelines-macro-usage) Explicitly providing compiler support macro functions
13// parasoft-begin-suppress AUTOSAR-A16_0_1-d-2 "This header defines contract macros to improve safety"
14// parasoft-begin-suppress AUTOSAR-A16_0_1-a-2 "Conditional defines permitted by A16-0-1 Permit #2"
15
16/// @def ARENE_DEPRECATED
17/// @brief An alias for the @c [[deprecated]] attribute, or a no-op if the attribute is not supported
18// parasoft-begin-suppress AUTOSAR-M16_0_7-a-2 "False positive: deprecated not used as a macro"
19#if ARENE_HAS_STD_ATTRIBUTE(deprecated)
20#define ARENE_DEPRECATED [[deprecated]]
21#else
22#define ARENE_DEPRECATED
23#endif
24// parasoft-end-suppress AUTOSAR-M16_0_7-a-2
25
26/// @def ARENE_DEPRECATED_WITH(...)
27/// @brief An alias for the @c [[deprecated(...)]] attribute, or a no-op if the attribute is not supported
28
29// parasoft-begin-suppress AUTOSAR-M16_0_7-a-2 "False positive: deprecated not used as a macro"
30#if ARENE_HAS_STD_ATTRIBUTE(deprecated)
31#define ARENE_DEPRECATED_WITH(...) [[deprecated(__VA_ARGS__)]]
32#else
33#define ARENE_DEPRECATED_WITH(...)
34#endif
35// parasoft-end-suppress AUTOSAR-M16_0_7-a-2
36
37// NOLINTEND(cppcoreguidelines-macro-usage) Explicitly providing compiler support macro functions
38// parasoft-end-suppress AUTOSAR-A16_0_1-d-2
39// parasoft-end-suppress AUTOSAR-A16_0_1-a-2
40
41#endif // INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_COMPILER_SUPPORT_ATTRIBUTES_DEPRECATED_HPP_