Commit f4c11fb6 authored by Steffen Müthing's avatar Steffen Müthing

[yaspgrid] Silence lots of compiler warnings in clang

The YaspGrid entity triggers an insane amount of compilation warnings when compiled with clang (see
the CI logs for examples).

This patch fixes the problem by adding the additional braces requested by the compiler.
parent e0d5fbb2
Pipeline #6836 passed with stage
in 50 minutes and 7 seconds
...@@ -71,12 +71,12 @@ namespace Dune { ...@@ -71,12 +71,12 @@ namespace Dune {
static constexpr std::array<int, sizeof...(I)> computeValues(std::index_sequence<I...>) static constexpr std::array<int, sizeof...(I)> computeValues(std::index_sequence<I...>)
{ {
int r = 0, c = 0; int r = 0, c = 0;
return { ((void)I, nextValue(r, c))... }; return {{ ((void)I, nextValue(r, c))... }};
} }
template<std::size_t... I> template<std::size_t... I>
static constexpr std::array<int, sizeof...(I)> computeOffsets(std::index_sequence<I...>) static constexpr std::array<int, sizeof...(I)> computeOffsets(std::index_sequence<I...>)
{ return { (I*(I+1)/2)... }; } { return {{ (I*(I+1)/2)... }}; }
static constexpr std::array<int,(n+1)*(n+2)/2> _values = computeValues(std::make_index_sequence<(n+1)*(n+2)/2>{}); static constexpr std::array<int,(n+1)*(n+2)/2> _values = computeValues(std::make_index_sequence<(n+1)*(n+2)/2>{});
static constexpr std::array<int,n+1> _offsets = computeOffsets(std::make_index_sequence<n+1>{}); static constexpr std::array<int,n+1> _offsets = computeOffsets(std::make_index_sequence<n+1>{});
...@@ -134,7 +134,7 @@ namespace Dune { ...@@ -134,7 +134,7 @@ namespace Dune {
static constexpr std::array<int, sizeof...(I)> computeOffsets(std::index_sequence<I...>) static constexpr std::array<int, sizeof...(I)> computeOffsets(std::index_sequence<I...>)
{ {
int offset = 0; int offset = 0;
return { (nextOffset(offset, I))... }; return {{ (nextOffset(offset, I))... }};
} }
// compute shift table entry for (`codim`, `i`) and advance `codim`, `i` // compute shift table entry for (`codim`, `i`) and advance `codim`, `i`
...@@ -155,7 +155,7 @@ namespace Dune { ...@@ -155,7 +155,7 @@ namespace Dune {
static constexpr std::array<unsigned char, sizeof...(I)> computeValues(std::index_sequence<I...>) static constexpr std::array<unsigned char, sizeof...(I)> computeValues(std::index_sequence<I...>)
{ {
int codim = 0, i = 0; int codim = 0, i = 0;
return { ((void)I, nextValue(codim, i))... }; return {{ ((void)I, nextValue(codim, i))... }};
} }
static constexpr std::array<int,dim+1> _offsets = computeOffsets(std::make_index_sequence<dim+1>{}); static constexpr std::array<int,dim+1> _offsets = computeOffsets(std::make_index_sequence<dim+1>{});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment