From 8046a2d791bce99d74eb5b3dcb70f643484fafec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Gr=C3=BCninger?= <gruenich@dune-project.org> Date: Wed, 19 Jan 2022 00:23:06 +0100 Subject: [PATCH] Remove deprecated DUNE_DEPRECATED and DUNE_DEPRECATED_MSG # Conflicts: # config.h.cmake --- CHANGELOG.md | 7 +++ cmake/modules/CheckCXXFeatures.cmake | 70 ---------------------------- config.h.cmake | 8 +--- doc/doxygen/doxygen-macros | 2 - dune/common/deprecated.hh | 27 +---------- 5 files changed, 10 insertions(+), 104 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6214267b..c905f7e39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,13 @@ - Deprecate cmake function `remove_processed_modules` +## Deprecations and removals + +- Both deprecated macros `DUNE_DEPRECATED` and `DUNE_DEPRECATED_MSG(text)` + are removed. Use C++14 attribute `[[deprecated]]`. However, be aware + that it is no drop-in replacement, as it must be sometimes placed at + different position in the code. + # Release 2.8 - Set minimal required CMake version in cmake to >= 3.13. diff --git a/cmake/modules/CheckCXXFeatures.cmake b/cmake/modules/CheckCXXFeatures.cmake index bf5a93618..d1d0e20df 100644 --- a/cmake/modules/CheckCXXFeatures.cmake +++ b/cmake/modules/CheckCXXFeatures.cmake @@ -13,12 +13,6 @@ # :code:`HAS_ATTRIBUTE_UNUSED` # True if attribute unused is supported # -# :code:`HAS_ATTRIBUTE_DEPRECATED` -# True if attribute deprecated is supported -# -# :code:`HAS_ATTRIBUTE_DEPRECATED_MSG` -# True if attribute deprecated("msg") is supported -# # .. cmake_variable:: DISABLE_CXX_VERSION_CHECK # # You may set this variable to TRUE to disable checking for @@ -198,70 +192,6 @@ check_cxx_source_compiles(" " HAS_ATTRIBUTE_UNUSED ) -# __attribute__((deprecated)) -check_cxx_source_compiles(" -#define DEP __attribute__((deprecated)) - class bar - { - bar() DEP; - }; - - class peng { } DEP; - - template <class T> - class t_bar - { - t_bar() DEP; - }; - - template <class T> - class t_peng { - t_peng() {}; - } DEP; - - void foo() DEP; - - void foo() {} - - int main(void) - { - return 0; - }; -" HAS_ATTRIBUTE_DEPRECATED -) - -# __attribute__((deprecated("msg"))) -check_cxx_source_compiles(" -#define DEP __attribute__((deprecated(\"message\"))) - class bar { - bar() DEP; - }; - - class peng { } DEP; - - template <class T> - class t_bar - { - t_bar() DEP; - }; - - template <class T> - class t_peng - { - t_peng() {}; - } DEP; - - void foo() DEP; - - void foo() {} - - int main(void) - { - return 0; - }; -" HAS_ATTRIBUTE_DEPRECATED_MSG -) - # ****************************************************************************** # # Checks for standard library features diff --git a/config.h.cmake b/config.h.cmake index 86b01980b..0779d8896 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -20,12 +20,6 @@ /* Standard debug streams with a level below will collapse to doing nothing */ #define DUNE_MINIMAL_DEBUG_LEVEL ${DUNE_MINIMAL_DEBUG_LEVEL} -/* does the compiler support __attribute__((deprecated))? */ -#cmakedefine HAS_ATTRIBUTE_DEPRECATED 1 - -/* does the compiler support __attribute__((deprecated("message"))? */ -#cmakedefine HAS_ATTRIBUTE_DEPRECATED_MSG 1 - /* does the compiler support __attribute__((unused))? */ #cmakedefine HAS_ATTRIBUTE_UNUSED 1 @@ -101,6 +95,8 @@ /* old feature support macros which were tested until 2.8, kept around for one more release */ +#define HAS_ATTRIBUTE_DEPRECATED 0 +#define HAS_ATTRIBUTE_DEPRECATED_MSG 0 /* Define to ENABLE_UMFPACK if the UMFPack library is available */ #cmakedefine HAVE_UMFPACK ENABLE_SUITESPARSE diff --git a/doc/doxygen/doxygen-macros b/doc/doxygen/doxygen-macros index ea9f105d4..e668260e0 100644 --- a/doc/doxygen/doxygen-macros +++ b/doc/doxygen/doxygen-macros @@ -8,8 +8,6 @@ PREDEFINED = DOXYGEN \ HAVE_MPI:=1 \ _DEBUG_ALLOCATOR_H:=1 \ - "DUNE_DEPRECATED:=/** \deprecated */" \ - "DUNE_DEPRECATED_MSG(A):=/** \deprecated A */" \ "DUNE_INLINE_VARIABLE:= " \ __cpp_inline_variables:=201606 \ __cpp_constexpr:=201603 \ diff --git a/dune/common/deprecated.hh b/dune/common/deprecated.hh index 6d367e608..25c335556 100644 --- a/dune/common/deprecated.hh +++ b/dune/common/deprecated.hh @@ -4,36 +4,11 @@ #define DUNE_DEPRECATED_HH /** \file - * \brief Definition of the DUNE_DEPRECATED macro for the case that config.h - * is not available + * \brief Definition of the `DUNE_NO_DEPRECATED_*` macros */ //! @addtogroup CxxUtilities //! @{ -#if defined(DOXYGEN) || !defined(HAS_ATTRIBUTE_DEPRECATED) -//! Mark some entity as deprecated -/** - * \deprecated Use C++14's \code[[deprecated]]\endcode instead. It will be - * removed after Dune 2.8. Be aware that it must be sometimes placed at - * different position in the code. - */ -#define DUNE_DEPRECATED -#else // defined(HAS_ATTRIBUTE_DEPRECATED) -#define DUNE_DEPRECATED __attribute__((deprecated)) -#endif - -#if defined(DOXYGEN) || !defined(HAS_ATTRIBUTE_DEPRECATED_MSG) -//! Mark some entity as deprecated -/** - * \deprecated Use C++14's \code[[deprecated(msg)]]\endcode instead. It - * will be removed after Dune 2.8. Be aware that it must be sometimes - * placed at different position in the code. - */ -#define DUNE_DEPRECATED_MSG(text) DUNE_DEPRECATED -#else // defined(HAS_ATTRIBUTE_DEPRECATED_MSG) -#define DUNE_DEPRECATED_MSG(text) __attribute__((deprecated(# text))) -#endif - #ifdef DOXYGEN /** * \brief Ignore deprecation warnings (start) -- GitLab