Skip to content
Snippets Groups Projects
Commit 505db0ab authored by Christoph Grüninger's avatar Christoph Grüninger
Browse files

Deprecate DUNE_UNUSED

No deprecation warning will be shown.
parent acc3cf1a
Branches
Tags
1 merge request!946Feature/maybe unused replace dune unused
......@@ -86,6 +86,12 @@
`[[deprecated]]` but be aware that it is no drop-in replacement,
as it must be sometimes placed at different position in the code.
- The macros `DUNE_UNUSED` is deprecated and will be removed after
Dune 2.8. Use C++17's attribute `[[maybe_unused]]` instead, but be
aware that it is no drop-in replacement, as it must be sometimes
placed at different position in the code.
The use of `DUNE_UNUSED_PARAMETER` is discouraged.
# Release 2.7
- Added fallback implementation to C++20 feature: `std::identity`.
......
......@@ -12,14 +12,22 @@
//! A macro for marking variables that the compiler mistakenly flags as unused, which sometimes happens due to templates.
/**
* \ingroup CxxUtilities
* \deprecated Use C++17's \code[[maybe_unused]]\endcode instead. This
* macro will be removed after Dune 2.8. Be aware that it must be
* sometimes placed at a different position in the code.
*/
#define DUNE_UNUSED
#else
#define DUNE_UNUSED __attribute__((unused))
#endif
/// A macro to mark intentionally unused function parameters with.
/**
* A macro to mark intentionally unused function parameters with.
*
* If possible use C++17's \code[[maybe_unused]]\endcode instead.
* Due to a bug prior to GCC 9.3 it cannot be used for the first
* argument of a constructor (bug 81429).
*
* \ingroup CxxUtilities
*/
#define DUNE_UNUSED_PARAMETER(parm) static_cast<void>(parm)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment