Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
maybe_unused.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_MAYBE_UNUSED_HPP_
6
#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_COMPILER_SUPPORT_ATTRIBUTES_MAYBE_UNUSED_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
11
#include "
arene/base/compiler_support/attributes/has_attribute.hpp
"
12
13
// NOLINTBEGIN(cppcoreguidelines-macro-usage) Explicitly providing compiler support macro functions
14
// parasoft-begin-suppress AUTOSAR-A16_0_1-d-2 "Conditional defines permitted by A16-0-1 Permit #2"
15
// parasoft-begin-suppress AUTOSAR-A16_0_1-a-2 "Conditional defines permitted by A16-0-1 Permit #2"
16
17
/// @def ARENE_MAYBE_UNUSED
18
/// @brief An alias for @c [[maybe_unused]] , or a no-op if the attribute is not supported
19
// parasoft-begin-suppress AUTOSAR-M16_0_7-a-2 "False positive: gnu and unused not used as a macro"
20
#if ARENE_HAS_STD_ATTRIBUTE(gnu::unused)
21
#define ARENE_MAYBE_UNUSED [[gnu::unused]]
22
#elif ARENE_HAS_STD_ATTRIBUTE(maybe_unused) >= 201603L
23
#define ARENE_MAYBE_UNUSED [[maybe_unused]]
24
#else
25
#define ARENE_MAYBE_UNUSED
26
#endif
27
// parasoft-end-suppress AUTOSAR-M16_0_7-a-2
28
29
// NOLINTEND(cppcoreguidelines-macro-usage) Explicitly providing compiler support macro functions
30
// parasoft-end-suppress AUTOSAR-A16_0_1-d-2
31
// parasoft-end-suppress AUTOSAR-A16_0_1-a-2
32
33
#endif
// INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_COMPILER_SUPPORT_ATTRIBUTES_MAYBE_UNUSED_HPP_
has_attribute.hpp
arene
base
compiler_support
attributes
maybe_unused.hpp
Generated by
1.13.2