)
RESET_CMAKE_REQUIRED()
ENDIF()
+
+
+#
+# GCC 4.8 (and possibly older) have a regression that prevents our "trick"
+# to allow multiplication of Tensor objects with std::complex<T> and
+# scalars U with different types T and U from working. In this case a
+# specialization is needed. See also base/product_type_02.cc and
+# base/product_type_03.cc
+#
+# - Matthias Maier, 2015
+#
+
+IF( CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND
+ CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9" )
+ SET(DEAL_II_GCC_COMPLEX_CONV_BUG TRUE)
+ENDIF()
#cmakedefine DEAL_II_BIND_NO_CONST_OP_PARENTHESES
#cmakedefine DEAL_II_CONSTEXPR_BUG
#cmakedefine DEAL_II_ICC_SFINAE_BUG
+#cmakedefine DEAL_II_GCC_COMPLEX_CONV_BUG
/***********************************************************************
}
+#ifdef DEAL_II_GCC_COMPLEX_CONV_BUG
+template <int dim, typename Number, typename OtherNumber>
+inline
+Tensor<1,dim,typename ProductType<Number, typename EnableIfScalar<OtherNumber>::type>::type>
+operator * (const Tensor<1,dim,Number> &t,
+ const OtherNumber factor)
+{
+ typedef typename ProductType<Number,OtherNumber>::type product_type;
+ Tensor<1,dim,product_type> tt;
+ for (unsigned int d=0; d<dim; ++d)
+ tt[d] = product_type(t[d]) * product_type(factor);
+ return tt;
+}
+#endif
+
+
/**
* Multiplication of a tensor of general rank with a scalar number from the
* left. See the discussion with the operator with switched arguments for more