]> https://gitweb.dealii.org/ - dealii.git/commitdiff
rename _HAVE_CXX14_CONSTEXPR_CAN_CALL_NONCONSTEXPR 9678/head
authorTimo Heister <timo.heister@gmail.com>
Wed, 18 Mar 2020 20:35:22 +0000 (16:35 -0400)
committerTimo Heister <timo.heister@gmail.com>
Wed, 18 Mar 2020 20:35:22 +0000 (16:35 -0400)
Rename DEAL_II_HAVE_CXX14_CONSTEXPR_CAN_CALL_NONCONSTEXPR to
DEAL_II_HAVE_CXX14_CONSTEXPR as it better expresses the meaning.

cmake/checks/check_01_cxx_features.cmake
cmake/checks/check_02_compiler_features.cmake
include/deal.II/base/config.h.in
include/deal.II/base/utilities.h
include/deal.II/physics/elasticity/standard_tensors.h
source/physics/elasticity/standard_tensors.cc

index 17aeeae4bc4239349a021dda8811b5f96e038da4..cc22fec6b5728e037a616bdf4637d460d0dbc491 100644 (file)
@@ -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 " ")
index 60820cfa80714893e356ccfe5573732f8768b832..4b599362ab58acac680ba578ba83892f93257995 100644 (file)
@@ -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; }
index 5980915aa71397af59b74bd17d4ed34b70cc3a78..b98b6a3f416e0a6a36c23f58b8aee161d171b61f 100644 (file)
  */
 
 #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@
index f064ce980864730d5a37b5fc73166b439fb36d5b..0282ce38ae7c09027d2545dc007b8bfdc1900fec 100644 (file)
@@ -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))
index 0f67edc4079b2628053517c40f0fd16cfba60add..32ded5074a110193930c6922140ee7c3334948eb 100644 (file)
@@ -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<dim>()
 #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<dim>()
 #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<dim>(),
                         unit_symmetric_tensor<dim>())
 #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<dim>()
 #endif
         ;
index bdae613b9af4bf2d0cba97d8967ae5e4c54b9d36..bd2c5b6c8ec7ee5af299e520417e6ca9ecdbdde2 100644 (file)
@@ -24,7 +24,7 @@ DEAL_II_NAMESPACE_OPEN
 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
   ;
@@ -34,7 +34,7 @@ DEAL_II_CONSTEXPR const SymmetricTensor<2, dim>
 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
   ;
@@ -44,7 +44,7 @@ DEAL_II_CONSTEXPR const SymmetricTensor<4, dim>
 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
   ;
@@ -54,7 +54,7 @@ DEAL_II_CONSTEXPR const SymmetricTensor<4, dim>
 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
   ;

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.