# DEAL_II_HAVE_CXX17_BESSEL_FUNCTIONS
# DEAL_II_HAVE_CXX17_LEGENDRE_FUNCTIONS
# DEAL_II_FALLTHROUGH
-# DEAL_II_DEPRECATED
-# DEAL_II_DEPRECATED_EARLY
# DEAL_II_CONSTEXPR
#
"${CMAKE_REQUIRED_FLAGS}${CMAKE_CXX_STANDARD}"
DEAL_II_HAVE_FP_EXCEPTIONS
DEAL_II_HAVE_COMPLEX_OPERATOR_OVERLOADS
- DEAL_II_HAVE_CXX17_ATTRIBUTE_DEPRECATED
- DEAL_II_HAVE_ATTRIBUTE_DEPRECATED
DEAL_II_HAVE_CXX17_ATTRIBUTE_FALLTHROUGH
DEAL_II_HAVE_ATTRIBUTE_FALLTHROUGH
DEAL_II_HAVE_CXX17_BESSEL_FUNCTIONS
"
DEAL_II_HAVE_COMPLEX_OPERATOR_OVERLOADS)
-
-#
-# Even though [[deprecated]] is a C++14 feature we have to check
-# whether we can actually use the [[deprecated]] attribute in all
-# cases we care about; some of the following are C++17 features.
-#
-CHECK_CXX_SOURCE_COMPILES(
- "
- [[deprecated]] int old_fn ();
- int old_fn () { return 0; }
-
- struct [[deprecated]] bob
- {
- [[deprecated]] bob(int i);
- [[deprecated]] void test();
- };
-
- enum color
- {
- red [[deprecated]]
- };
-
- template <int dim>
- struct foo {};
- using bar [[deprecated]] = foo<2>;
-
- int main () {}
- "
- DEAL_II_HAVE_CXX17_ATTRIBUTE_DEPRECATED
- )
-
-#
-# Also test the corresponding GCC extension
-#
-CHECK_CXX_SOURCE_COMPILES(
- "
- __attribute__((deprecated)) int old_fn ();
- int old_fn () { return 0; }
-
- struct __attribute__((deprecated)) bob
- {
- __attribute__((deprecated)) bob(int i);
- __attribute__((deprecated)) void test();
- };
-
- enum color
- {
- red __attribute__((deprecated))
- };
-
- template <int dim>
- struct foo {};
- using bar __attribute__((deprecated)) = foo<2>;
-
- int main () {}
- "
- DEAL_II_HAVE_ATTRIBUTE_DEPRECATED
- )
-
-if(DEAL_II_HAVE_CXX17_ATTRIBUTE_DEPRECATED)
- set(DEAL_II_DEPRECATED "[[deprecated]]")
-elseif(DEAL_II_HAVE_ATTRIBUTE_DEPRECATED AND NOT DEAL_II_WITH_CUDA)
- set(DEAL_II_DEPRECATED "__attribute__((deprecated))")
-else()
- set(DEAL_II_DEPRECATED " ")
-endif()
-if(DEAL_II_EARLY_DEPRECATIONS)
- set(DEAL_II_DEPRECATED_EARLY ${DEAL_II_DEPRECATED})
-else()
- set(DEAL_II_DEPRECATED_EARLY " ")
-endif()
-
-
#
# Try to enable a fallthrough attribute. This is a language feature in C++17,
# but a compiler extension in earlier language versions.
* Macro indicating that the current feature will be removed in a future
* release.
*/
-#cmakedefine DEAL_II_DEPRECATED @DEAL_II_DEPRECATED@
+#define DEAL_II_DEPRECATED [[deprecated]]
+#define DEAL_II_DEPRECATED_WITH_COMMENT(comment) [[deprecated(comment)]]
/**
* Same as above, but for things that have been deprecated during the current
* deprecated prior to a release until <em>after</em> that release has been
* finalized - see DEAL_II_EARLY_DEPRECATIONS for more information.
*/
+#cmakedefine DEAL_II_EARLY_DEPRECATIONS
#ifndef DEAL_II_DEPRECATED_EARLY
// guard to allow user to override DEAL_II_DEPRECATED_EARLY
-#cmakedefine DEAL_II_DEPRECATED_EARLY @DEAL_II_DEPRECATED_EARLY@
+#ifdef DEAL_II_EARLY_DEPRECATIONS
+#define DEAL_II_DEPRECATED_EARLY [[deprecated]]
+#else
+#define DEAL_II_DEPRECATED_EARLY
+#endif
+#endif
+
+#ifndef DEAL_II_DEPRECATED_EARLY_WITH_COMMENT
+// guard to allow user to override DEAL_II_DEPRECATED_EARLY
+#ifdef DEAL_II_EARLY_DEPRECATIONS
+#define DEAL_II_DEPRECATED_EARLY_WITH_COMMENT(comment) [[deprecated(comment)]]
+#else
+#define DEAL_II_DEPRECATED_EARLY_WITH_COMMENT(comment)
#endif
+#endif
+
#cmakedefine DEAL_II_FALLTHROUGH @DEAL_II_FALLTHROUGH@
#cmakedefine DEAL_II_CONSTEXPR @DEAL_II_CONSTEXPR@