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

Remove deprecated DUNE_DEPRECATED and DUNE_DEPRECATED_MSG

# Conflicts:
#	config.h.cmake
parent bcf51d43
No related branches found
No related tags found
1 merge request!1076Remove deprecated code parts or properly deprecate parts that were meant for removal
......@@ -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.
......
......@@ -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
......
......@@ -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
......
......@@ -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 \
......
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment