#
# DEAL_II_HAVE_ATTRIBUTE_FALLTHROUGH
# DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE
-# DEAL_II_HAVE_CXX14_CONSTEXPR_CAN_CALL_NONCONSTEXPR
+# DEAL_II_HAVE_CXX14_CONSTEXPR
# DEAL_II_HAVE_FP_EXCEPTIONS
# DEAL_II_HAVE_COMPLEX_OPERATOR_OVERLOADS
#
"${CMAKE_REQUIRED_FLAGS}${DEAL_II_CXX_VERSION_FLAG}${DEAL_II_WITH_CXX14}${DEAL_II_WITH_CXX17}"
DEAL_II_HAVE_ATTRIBUTE_FALLTHROUGH
DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE
- DEAL_II_HAVE_CXX14_CONSTEXPR_CAN_CALL_NONCONSTEXPR
+ DEAL_II_HAVE_CXX14_CONSTEXPR
DEAL_II_HAVE_FP_EXCEPTIONS
DEAL_II_HAVE_COMPLEX_OPERATOR_OVERLOADS
)
"
DEAL_II_HAVE_COMPLEX_OPERATOR_OVERLOADS)
+#
+# Check for correct c++14 constexpr support.
#
# As long as there exists an argument value such that an invocation of the
# function or constructor could be an evaluated subexpression of a core constant
# We only run this check if we have CXX14 support, otherwise the use of constexpr
# is limited (non-const constexpr functions for example).
#
-#
IF(DEAL_II_WITH_CXX14 AND NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
CHECK_CXX_SOURCE_COMPILES(
"
return n;
}
"
- DEAL_II_HAVE_CXX14_CONSTEXPR_CAN_CALL_NONCONSTEXPR)
+ DEAL_II_HAVE_CXX14_CONSTEXPR)
ENDIF()
#
# functions. This requirement is probabely very conservative in most cases, but
# it will prevent breaking builds with certain compilers.
#
-IF (DEAL_II_HAVE_CXX14_CONSTEXPR_CAN_CALL_NONCONSTEXPR)
+IF (DEAL_II_HAVE_CXX14_CONSTEXPR)
SET(DEAL_II_CONSTEXPR "constexpr")
ELSE()
SET(DEAL_II_CONSTEXPR " ")
# - Matthias Maier, rewritten 2012
#
IF(NOT(CMAKE_CXX_COMPILER_ID MATCHES "Intel" AND
- DEAL_II_HAVE_CXX14_CONSTEXPR_CAN_CALL_NONCONSTEXPR))
+ DEAL_II_HAVE_CXX14_CONSTEXPR))
CHECK_CXX_SOURCE_COMPILES(
"
bool f() { return true; }
*/
#cmakedefine DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE
-#cmakedefine DEAL_II_HAVE_CXX14_CONSTEXPR_CAN_CALL_NONCONSTEXPR
+#cmakedefine DEAL_II_HAVE_CXX14_CONSTEXPR
#cmakedefine DEAL_II_HAVE_FP_EXCEPTIONS
#cmakedefine DEAL_II_HAVE_COMPLEX_OPERATOR_OVERLOADS
#cmakedefine DEAL_II_FALLTHROUGH @DEAL_II_FALLTHROUGH@
constexpr unsigned int
pow(const unsigned int base, const int iexp)
{
-#if defined(DEBUG) && defined(DEAL_II_WITH_CXX14) && \
- defined(DEAL_II_HAVE_CXX14_CONSTEXPR_CAN_CALL_NONCONSTEXPR)
+#if defined(DEBUG) && defined(DEAL_II_HAVE_CXX14_CONSTEXPR)
// Up to __builtin_expect this is the same code as in the 'Assert' macro.
// The call to __builtin_expect turns out to be problematic.
if (!(iexp >= 0))
* matrix, then this simply corresponds to the identity matrix.
*/
static DEAL_II_CONSTEXPR const SymmetricTensor<2, dim> I
-#ifdef DEAL_II_HAVE_CXX14_CONSTEXPR_CAN_CALL_NONCONSTEXPR
+#ifdef DEAL_II_HAVE_CXX14_CONSTEXPR
= unit_symmetric_tensor<dim>()
#endif
;
* operator.
*/
static DEAL_II_CONSTEXPR const SymmetricTensor<4, dim> S
-#ifdef DEAL_II_HAVE_CXX14_CONSTEXPR_CAN_CALL_NONCONSTEXPR
+#ifdef DEAL_II_HAVE_CXX14_CONSTEXPR
= identity_tensor<dim>()
#endif
;
* @f]
*/
static DEAL_II_CONSTEXPR const SymmetricTensor<4, dim> IxI
-#ifdef DEAL_II_HAVE_CXX14_CONSTEXPR_CAN_CALL_NONCONSTEXPR
+#ifdef DEAL_II_HAVE_CXX14_CONSTEXPR
= outer_product(unit_symmetric_tensor<dim>(),
unit_symmetric_tensor<dim>())
#endif
* @dealiiHolzapfelA{232,6.105}
*/
static DEAL_II_CONSTEXPR const SymmetricTensor<4, dim> dev_P
-#ifdef DEAL_II_HAVE_CXX14_CONSTEXPR_CAN_CALL_NONCONSTEXPR
+#ifdef DEAL_II_HAVE_CXX14_CONSTEXPR
= deviator_tensor<dim>()
#endif
;
template <int dim>
DEAL_II_CONSTEXPR const SymmetricTensor<2, dim>
Physics::Elasticity::StandardTensors<dim>::I
-# ifndef DEAL_II_HAVE_CXX14_CONSTEXPR_CAN_CALL_NONCONSTEXPR
+# ifndef DEAL_II_HAVE_CXX14_CONSTEXPR
= unit_symmetric_tensor<dim>()
# endif
;
template <int dim>
DEAL_II_CONSTEXPR const SymmetricTensor<4, dim>
Physics::Elasticity::StandardTensors<dim>::S
-# ifndef DEAL_II_HAVE_CXX14_CONSTEXPR_CAN_CALL_NONCONSTEXPR
+# ifndef DEAL_II_HAVE_CXX14_CONSTEXPR
= identity_tensor<dim>()
# endif
;
template <int dim>
DEAL_II_CONSTEXPR const SymmetricTensor<4, dim>
Physics::Elasticity::StandardTensors<dim>::IxI
-# ifndef DEAL_II_HAVE_CXX14_CONSTEXPR_CAN_CALL_NONCONSTEXPR
+# ifndef DEAL_II_HAVE_CXX14_CONSTEXPR
= outer_product(unit_symmetric_tensor<dim>(), unit_symmetric_tensor<dim>())
# endif
;
template <int dim>
DEAL_II_CONSTEXPR const SymmetricTensor<4, dim>
Physics::Elasticity::StandardTensors<dim>::dev_P
-# ifndef DEAL_II_HAVE_CXX14_CONSTEXPR_CAN_CALL_NONCONSTEXPR
+# ifndef DEAL_II_HAVE_CXX14_CONSTEXPR
= deviator_tensor<dim>()
# endif
;