]> https://gitweb.dealii.org/ - dealii.git/commitdiff
bugfix
authorMatthias Maier <tamiko@43-1.org>
Fri, 22 May 2020 19:06:07 +0000 (14:06 -0500)
committerMatthias Maier <tamiko@43-1.org>
Sat, 23 May 2020 14:59:23 +0000 (09:59 -0500)
cmake/checks/check_01_cxx_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 fd4f6c498b6489a500f00647ce69cd9be742891c..11b1789e1b435cfd9e0aa3a9c50a803c5ab06a19 100644 (file)
@@ -251,13 +251,11 @@ ENDMACRO()
 #
 
 _set_up_cmake_required()
-
 _test_cxx14_support()
 
 IF(NOT DEAL_II_HAVE_CXX14)
   MESSAGE(STATUS "C++14 support not available. Try to set -std=c++14 explicitly")
   ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-std=c++14")
-  ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "/std:c++14")
   _set_up_cmake_required()
   _test_cxx14_support()
 ENDIF()
@@ -511,7 +509,12 @@ ENDIF()
 # We only run this check if we have CXX14 support, otherwise the use of constexpr
 # is limited (non-const constexpr functions for example).
 #
-IF(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
+
+# MSVC has considerable problems with "constexpr", disable unconditionally
+# for now
+IF(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
+  SET(DEAL_II_CXX14_CONSTEXPR_BUG true)
+ELSE()
   CHECK_CXX_COMPILER_BUG(
     "
     #define Assert(x,y) if (!(x)) throw y;
index 9b876ff034051589c6b871a41e8f86045d2fb25d..a2c1d4cd163d1ccedc17cfe77804b8813f4f69be 100644 (file)
 
 #cmakedefine DEAL_II_HAVE_FP_EXCEPTIONS
 #cmakedefine DEAL_II_HAVE_COMPLEX_OPERATOR_OVERLOADS
-#cmakedefine DEAL_II_CXX14_CONSTEXPR_BUG_OK
+#cmakedefine DEAL_II_CXX14_CONSTEXPR_BUG
 
 #cmakedefine DEAL_II_DEPRECATED @DEAL_II_DEPRECATED@
 #cmakedefine DEAL_II_FALLTHROUGH @DEAL_II_FALLTHROUGH@
index 63be355f775c88854b74e364b62c08fe2e9b09cc..7166f96731d86736dc74483426b60cc57caf38d0 100644 (file)
@@ -475,7 +475,7 @@ namespace Utilities
   constexpr T
   pow(const T base, const int iexp)
   {
-#if defined(DEBUG) && defined(DEAL_II_CXX14_CONSTEXPR_BUG_OK)
+#if defined(DEBUG) && !defined(DEAL_II_CXX14_CONSTEXPR_BUG)
     // 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 dd8d355c67297d45bb2de60627ebcdf8fceec9c4..d24820e985f70f49365c9bccbea6ea5e9797dc59 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_CXX14_CONSTEXPR_BUG_OK
+#ifndef DEAL_II_CXX14_CONSTEXPR_BUG
         = unit_symmetric_tensor<dim>()
 #endif
         ;
@@ -103,7 +103,7 @@ namespace Physics
        * operator.
        */
       static DEAL_II_CONSTEXPR const SymmetricTensor<4, dim> S
-#ifdef DEAL_II_CXX14_CONSTEXPR_BUG_OK
+#ifndef DEAL_II_CXX14_CONSTEXPR_BUG
         = identity_tensor<dim>()
 #endif
         ;
@@ -119,7 +119,7 @@ namespace Physics
        * @f]
        */
       static DEAL_II_CONSTEXPR const SymmetricTensor<4, dim> IxI
-#ifdef DEAL_II_CXX14_CONSTEXPR_BUG_OK
+#ifndef DEAL_II_CXX14_CONSTEXPR_BUG
         = 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_CXX14_CONSTEXPR_BUG_OK
+#ifndef DEAL_II_CXX14_CONSTEXPR_BUG
         = deviator_tensor<dim>()
 #endif
         ;
index 886a7ff2204134a066d0dc7164228d7c26a5b04d..546b0cee62ece8e9c2d68b2fb3a3f2611b49103f 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_CXX14_CONSTEXPR_BUG_OK
+#  ifdef DEAL_II_CXX14_CONSTEXPR_BUG
   = 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_CXX14_CONSTEXPR_BUG_OK
+#  ifdef DEAL_II_CXX14_CONSTEXPR_BUG
   = 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_CXX14_CONSTEXPR_BUG_OK
+#  ifdef DEAL_II_CXX14_CONSTEXPR_BUG
   = 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_CXX14_CONSTEXPR_BUG_OK
+#  ifdef DEAL_II_CXX14_CONSTEXPR_BUG
   = 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.