From: Timo Heister Date: Wed, 18 Mar 2020 20:35:22 +0000 (-0400) Subject: rename _HAVE_CXX14_CONSTEXPR_CAN_CALL_NONCONSTEXPR X-Git-Tag: v9.2.0-rc1~406^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F9678%2Fhead;p=dealii.git rename _HAVE_CXX14_CONSTEXPR_CAN_CALL_NONCONSTEXPR Rename DEAL_II_HAVE_CXX14_CONSTEXPR_CAN_CALL_NONCONSTEXPR to DEAL_II_HAVE_CXX14_CONSTEXPR as it better expresses the meaning. --- diff --git a/cmake/checks/check_01_cxx_features.cmake b/cmake/checks/check_01_cxx_features.cmake index 17aeeae4bc..cc22fec6b5 100644 --- a/cmake/checks/check_01_cxx_features.cmake +++ b/cmake/checks/check_01_cxx_features.cmake @@ -23,7 +23,7 @@ # # 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 # @@ -580,7 +580,7 @@ UNSET_IF_CHANGED(CHECK_CXX_FEATURES_FLAGS_SAVED "${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 ) @@ -725,6 +725,8 @@ CHECK_CXX_SOURCE_COMPILES( " 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 @@ -739,7 +741,6 @@ CHECK_CXX_SOURCE_COMPILES( # 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( " @@ -762,7 +763,7 @@ IF(DEAL_II_WITH_CXX14 AND NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC") return n; } " - DEAL_II_HAVE_CXX14_CONSTEXPR_CAN_CALL_NONCONSTEXPR) + DEAL_II_HAVE_CXX14_CONSTEXPR) ENDIF() # @@ -771,7 +772,7 @@ 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 " ") diff --git a/cmake/checks/check_02_compiler_features.cmake b/cmake/checks/check_02_compiler_features.cmake index 60820cfa80..4b599362ab 100644 --- a/cmake/checks/check_02_compiler_features.cmake +++ b/cmake/checks/check_02_compiler_features.cmake @@ -127,7 +127,7 @@ CHECK_CXX_COMPILER_BUG( # - 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; } diff --git a/include/deal.II/base/config.h.in b/include/deal.II/base/config.h.in index 5980915aa7..b98b6a3f41 100644 --- a/include/deal.II/base/config.h.in +++ b/include/deal.II/base/config.h.in @@ -127,7 +127,7 @@ */ #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@ diff --git a/include/deal.II/base/utilities.h b/include/deal.II/base/utilities.h index f064ce9808..0282ce38ae 100644 --- a/include/deal.II/base/utilities.h +++ b/include/deal.II/base/utilities.h @@ -486,8 +486,7 @@ namespace Utilities 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)) diff --git a/include/deal.II/physics/elasticity/standard_tensors.h b/include/deal.II/physics/elasticity/standard_tensors.h index 0f67edc407..32ded5074a 100644 --- a/include/deal.II/physics/elasticity/standard_tensors.h +++ b/include/deal.II/physics/elasticity/standard_tensors.h @@ -70,7 +70,7 @@ namespace Physics * 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() #endif ; @@ -103,7 +103,7 @@ namespace Physics * 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() #endif ; @@ -119,7 +119,7 @@ namespace Physics * @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(), unit_symmetric_tensor()) #endif @@ -169,7 +169,7 @@ namespace Physics * @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() #endif ; diff --git a/source/physics/elasticity/standard_tensors.cc b/source/physics/elasticity/standard_tensors.cc index bdae613b9a..bd2c5b6c8e 100644 --- a/source/physics/elasticity/standard_tensors.cc +++ b/source/physics/elasticity/standard_tensors.cc @@ -24,7 +24,7 @@ DEAL_II_NAMESPACE_OPEN template DEAL_II_CONSTEXPR const SymmetricTensor<2, dim> Physics::Elasticity::StandardTensors::I -# ifndef DEAL_II_HAVE_CXX14_CONSTEXPR_CAN_CALL_NONCONSTEXPR +# ifndef DEAL_II_HAVE_CXX14_CONSTEXPR = unit_symmetric_tensor() # endif ; @@ -34,7 +34,7 @@ DEAL_II_CONSTEXPR const SymmetricTensor<2, dim> template DEAL_II_CONSTEXPR const SymmetricTensor<4, dim> Physics::Elasticity::StandardTensors::S -# ifndef DEAL_II_HAVE_CXX14_CONSTEXPR_CAN_CALL_NONCONSTEXPR +# ifndef DEAL_II_HAVE_CXX14_CONSTEXPR = identity_tensor() # endif ; @@ -44,7 +44,7 @@ DEAL_II_CONSTEXPR const SymmetricTensor<4, dim> template DEAL_II_CONSTEXPR const SymmetricTensor<4, dim> Physics::Elasticity::StandardTensors::IxI -# ifndef DEAL_II_HAVE_CXX14_CONSTEXPR_CAN_CALL_NONCONSTEXPR +# ifndef DEAL_II_HAVE_CXX14_CONSTEXPR = outer_product(unit_symmetric_tensor(), unit_symmetric_tensor()) # endif ; @@ -54,7 +54,7 @@ DEAL_II_CONSTEXPR const SymmetricTensor<4, dim> template DEAL_II_CONSTEXPR const SymmetricTensor<4, dim> Physics::Elasticity::StandardTensors::dev_P -# ifndef DEAL_II_HAVE_CXX14_CONSTEXPR_CAN_CALL_NONCONSTEXPR +# ifndef DEAL_II_HAVE_CXX14_CONSTEXPR = deviator_tensor() # endif ;