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// IWYU pragma: friend "(arene/base(?!/tests)|stdlib/include/stdlib_detail)/.*"
10
12
13// NOLINTBEGIN(cppcoreguidelines-macro-usage) Explicitly providing compiler support macro functions
14// parasoft-begin-suppress AUTOSAR-A16_0_1-d-2 "This header defines contract macros to improve safety"
15// parasoft-begin-suppress AUTOSAR-A16_0_1-a-2 "Conditional defines permitted by A16-0-1 Permit #2"
16
17/// @def ARENE_DEPRECATED
18/// @brief An alias for the @c [[deprecated]] attribute, or a no-op if the attribute is not supported
19// parasoft-begin-suppress AUTOSAR-M16_0_7-a-2 "False positive: deprecated not used as a macro"
20#if ARENE_HAS_STD_ATTRIBUTE(deprecated)
21#define ARENE_DEPRECATED [[deprecated]]
22#else
23#define ARENE_DEPRECATED
24#endif
25// parasoft-end-suppress AUTOSAR-M16_0_7-a-2
26
27/// @def ARENE_DEPRECATED_WITH(...)
28/// @brief An alias for the @c [[deprecated(...)]] attribute, or a no-op if the attribute is not supported
29
30// parasoft-begin-suppress AUTOSAR-M16_0_7-a-2 "False positive: deprecated not used as a macro"
31#if ARENE_HAS_STD_ATTRIBUTE(deprecated)
32#define ARENE_DEPRECATED_WITH(...) [[deprecated(__VA_ARGS__)]]
33#else
34#define ARENE_DEPRECATED_WITH(...)
35#endif
36// parasoft-end-suppress AUTOSAR-M16_0_7-a-2
37
38// NOLINTEND(cppcoreguidelines-macro-usage) Explicitly providing compiler support macro functions
39// parasoft-end-suppress AUTOSAR-A16_0_1-d-2
40// parasoft-end-suppress AUTOSAR-A16_0_1-a-2
41
42#endif // INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_COMPILER_SUPPORT_ATTRIBUTES_DEPRECATED_HPP_