SET(DEAL_II_USE_CXX11 FALSE)
ENDIF()
+#
+# gcc-4.8.1 has some problems with the constexpr "vertices_per_cell" in the
+# definition of alternating_form_at_vertices.
+#
+# TODO: Write a unit test.
+#
+# For now, just enable the workaround for Windows targets
+#
+# - Matthias Maier, 2013
+#
+
+IF( CMAKE_SYSTEM_NAME MATCHES "CYGWIN"
+ OR CMAKE_SYSTEM_NAME MATCHES "Windows" )
+ SET(DEAL_II_CONSTEXPR_BUG TRUE)
+ENDIF()
/****************************************
- * Configured in check_2_compiler_bugs: *
+ * Configured in check_3_compiler_bugs: *
****************************************/
/* Defined if we have to work around a bug with some compilers that will not
*/
#cmakedefine DEAL_II_BOOST_BIND_COMPILER_BUG
+/* Defined if the compiler incorrectly deduces a constexpr as not being a
+ * constant integral expression under certain optimization (notably
+ * gcc-4.8.1 on Windows and Mac)
+ */
+#cmakedefine DEAL_II_CONSTEXPR_BUG
+
/*****************************************
* Configured in configure_arpack.cmake: *
* in the glossary).
*/
template <int spacedim>
- static
- void
+ static void
alternating_form_at_vertices
- (const Point<spacedim> (&vertices)[vertices_per_cell],
- Tensor<spacedim-dim,spacedim> (&forms)[vertices_per_cell]);
+#ifndef DEAL_II_CONSTEXPR_BUG
+ (const Point<spacedim> (&vertices)[vertices_per_cell],
+ Tensor<spacedim-dim,spacedim> (&forms)[vertices_per_cell]);
+#else
+ (const Point<spacedim> *vertices,
+ Tensor<spacedim-dim,spacedim> *forms);
+#endif
/**
* For each face of the reference
void
GeometryInfo<dim>::
alternating_form_at_vertices
-(const Point<spacedim> (&vertices)[vertices_per_cell],
- Tensor<spacedim-dim,spacedim> (&forms)[vertices_per_cell])
+#ifndef DEAL_II_CONSTEXPR_BUG
+ (const Point<spacedim> (&vertices)[vertices_per_cell],
+ Tensor<spacedim-dim,spacedim> (&forms)[vertices_per_cell])
+#else
+ (const Point<spacedim> *vertices,
+ Tensor<spacedim-dim,spacedim> *forms)
+#endif
{
// for each of the vertices,
// compute the alternating form
void
GeometryInfo<1>::
alternating_form_at_vertices
-(const Point<1> (&vertices)[vertices_per_cell],
- Tensor<1-1,1> (&forms)[vertices_per_cell])
+#ifndef DEAL_II_CONSTEXPR_BUG
+(const Point<1> (&)[vertices_per_cell],
+ Tensor<1-1,1> (&)[vertices_per_cell])
+#else
+(const Point<1> *, Tensor<1-1,1> *)
+#endif
;
template
void
GeometryInfo<1>::
alternating_form_at_vertices
-(const Point<2> (&vertices)[vertices_per_cell],
- Tensor<2-1,2> (&forms)[vertices_per_cell])
+#ifndef DEAL_II_CONSTEXPR_BUG
+(const Point<2> (&)[vertices_per_cell],
+ Tensor<2-1,2> (&)[vertices_per_cell])
+#else
+(const Point<2> *, Tensor<2-1,2> *)
+#endif
;
template
void
GeometryInfo<2>::
alternating_form_at_vertices
+#ifndef DEAL_II_CONSTEXPR_BUG
(const Point<2> (&vertices)[vertices_per_cell],
Tensor<2-2,2> (&forms)[vertices_per_cell])
+#else
+(const Point<2> *, Tensor<2-2,2> *)
+#endif
;
template
void
GeometryInfo<2>::
alternating_form_at_vertices
+#ifndef DEAL_II_CONSTEXPR_BUG
(const Point<3> (&vertices)[vertices_per_cell],
Tensor<3-2,3> (&forms)[vertices_per_cell])
+#else
+(const Point<3> *, Tensor<3-2,3> *)
+#endif
;
void
GeometryInfo<3>::
alternating_form_at_vertices
+#ifndef DEAL_II_CONSTEXPR_BUG
(const Point<3> (&vertices)[vertices_per_cell],
Tensor<3-3,3> (&forms)[vertices_per_cell])
+#else
+(const Point<3> *, Tensor<3-3,3> *)
+#endif
;
for (unsigned int i=0; i<GeometryInfo<structdim>::vertices_per_cell; ++i)
parent_vertices[i] = object->vertex(i);
- GeometryInfo<structdim>::template alternating_form_at_vertices<spacedim>
- (parent_vertices, parent_alternating_forms);
+ GeometryInfo<structdim>::alternating_form_at_vertices (parent_vertices,
+ parent_alternating_forms);
const Tensor<spacedim-structdim,spacedim>
average_parent_alternating_form
= object_mid_point;
for (unsigned int c=0; c<object->n_children(); ++c)
- GeometryInfo<structdim>::template alternating_form_at_vertices<spacedim>
- (child_vertices[c], child_alternating_forms[c]);
+ GeometryInfo<structdim>::alternating_form_at_vertices (child_vertices[c],
+ child_alternating_forms[c]);
// on a uniformly refined
// hypercube object, the child
Tensor<spacedim-structdim,spacedim> parent_alternating_forms
[GeometryInfo<structdim>::vertices_per_cell];
- GeometryInfo<structdim>::template alternating_form_at_vertices<spacedim>
- (parent_vertices, parent_alternating_forms);
+ GeometryInfo<structdim>::alternating_form_at_vertices (parent_vertices,
+ parent_alternating_forms);
Point<spacedim> child_vertices
[GeometryInfo<structdim>::max_children_per_cell]
[GeometryInfo<structdim>::vertices_per_cell];
for (unsigned int c=0; c<object->n_children(); ++c)
- GeometryInfo<structdim>::template alternating_form_at_vertices<spacedim>
- (child_vertices[c], child_alternating_forms[c]);
+ GeometryInfo<structdim>::alternating_form_at_vertices (child_vertices[c],
+ child_alternating_forms[c]);
old_min_product = child_alternating_forms[0][0] * parent_alternating_forms[0];
for (unsigned int c=0; c<object->n_children(); ++c)
= object_mid_point;
for (unsigned int c=0; c<object->n_children(); ++c)
- GeometryInfo<structdim>::template alternating_form_at_vertices<spacedim>
- (child_vertices[c], child_alternating_forms[c]);
+ GeometryInfo<structdim>::alternating_form_at_vertices (child_vertices[c],
+ child_alternating_forms[c]);
new_min_product = child_alternating_forms[0][0] * parent_alternating_forms[0];
for (unsigned int c=0; c<object->n_children(); ++c)