]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix compilation with GCC 5.4. 12666/head
authorDavid Wells <drwells@email.unc.edu>
Wed, 18 Aug 2021 13:58:06 +0000 (09:58 -0400)
committerDavid Wells <drwells@email.unc.edu>
Wed, 18 Aug 2021 13:58:06 +0000 (09:58 -0400)
Using constexpr here causes an internal compiler error when optimizations are
turned on.

include/deal.II/base/symmetric_tensor.h

index 02cb46de8ba86387b538acffc6583856a63be746..60a61ed182c058185d729a44c28e9f51cd6a1714 100644 (file)
@@ -136,7 +136,7 @@ constexpr inline DEAL_II_ALWAYS_INLINE SymmetricTensor<2, dim, Number>
 deviator(const SymmetricTensor<2, dim, Number> &);
 
 template <int dim, typename Number>
-constexpr inline DEAL_II_ALWAYS_INLINE Number
+DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE Number
 determinant(const SymmetricTensor<2, dim, Number> &);
 
 
@@ -1031,7 +1031,7 @@ private:
   trace(const SymmetricTensor<2, dim2, Number2> &d);
 
   template <int dim2, typename Number2>
-  friend constexpr Number2
+  friend DEAL_II_CONSTEXPR Number2
   determinant(const SymmetricTensor<2, dim2, Number2> &t);
 
   template <int dim2, typename Number2>
@@ -2693,7 +2693,7 @@ constexpr DEAL_II_ALWAYS_INLINE
  * @relatesalso SymmetricTensor
  */
 template <int dim, typename Number>
-constexpr inline DEAL_II_ALWAYS_INLINE Number
+DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE Number
 determinant(const SymmetricTensor<2, dim, Number> &t)
 {
   switch (dim)
@@ -2733,7 +2733,7 @@ determinant(const SymmetricTensor<2, dim, Number> &t)
  * @relatesalso SymmetricTensor
  */
 template <int dim, typename Number>
-constexpr DEAL_II_ALWAYS_INLINE Number
+DEAL_II_CONSTEXPR DEAL_II_ALWAYS_INLINE Number
 third_invariant(const SymmetricTensor<2, dim, Number> &t)
 {
   return determinant(t);

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.