#
_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()
# 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;
#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@
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))
* 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
;
* 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
;
* @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
* @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
;
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
;
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
;
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
;
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
;