From: Matthias Maier Date: Mon, 20 Apr 2015 13:00:03 +0000 (+0200) Subject: Work around a bug in gcc-4.7 wrt initalizer lists in function arguments. X-Git-Tag: v8.3.0-rc1~231^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31cb300c58e19e24bf2f9031e42999560708fd9f;p=dealii.git Work around a bug in gcc-4.7 wrt initalizer lists in function arguments. --- diff --git a/tests/lac/linear_operator_05.cc b/tests/lac/linear_operator_05.cc index 958df9fcf1..d0bb18ffd3 100644 --- a/tests/lac/linear_operator_05.cc +++ b/tests/lac/linear_operator_05.cc @@ -105,8 +105,9 @@ int main() auto op_b10 = linear_operator(a.block(1, 0)); auto op_b11 = linear_operator(a.block(1, 1)); - auto op_b = - block_operator<2, 2, BlockVector>({op_b00, op_b01, op_b10, op_b11}); + std::array, 2> temp{op_b00, op_b01, op_b10, + op_b11}; + auto op_b = block_operator<2, 2, BlockVector>(temp); // vmult: @@ -173,8 +174,9 @@ int main() // And finally complicated block structures: - auto op_upp_x_upu = block_operator<3, 3, BlockVector>( - {op_b00, op_b01, op_b00, op_b10, op_b11, op_b10, op_b10, op_b11, op_b10}); + std::array, 3> temp2{ + op_b00, op_b01, op_b00, op_b10, op_b11, op_b10, op_b10, op_b11, op_b10}; + auto op_upp_x_upu = block_operator<3, 3, BlockVector>(temp2); op_upp_x_upu.reinit_domain_vector(u, false); for (unsigned int i = 0; i < u.size(); ++i) { @@ -190,11 +192,11 @@ int main() op_upp_x_upu.vmult_add(v, u); PRINTME("v", v); - auto op_upp_x_p = - block_operator<3, 1, BlockVector>({op_b01, op_b11, op_b11}); + std::array, 3> temp3{op_b01, op_b11, op_b11}; + auto op_upp_x_p = block_operator<3, 1, BlockVector>(temp3); - auto op_u_x_upu = - block_operator<1, 3, BlockVector>({op_b00, op_b01, op_b00}); + std::array, 1> temp4{op_b00, op_b01, op_b00}; + auto op_u_x_upu = block_operator<1, 3, BlockVector>(temp4); auto op_long = op_u_x_upu * transpose_operator(op_upp_x_upu) * op_upp_x_p; diff --git a/tests/lac/linear_operator_07.cc b/tests/lac/linear_operator_07.cc index 53711def2d..4f630bbfbe 100644 --- a/tests/lac/linear_operator_07.cc +++ b/tests/lac/linear_operator_07.cc @@ -84,8 +84,9 @@ int main() auto op_b1 = linear_operator(a.block(1, 1)); auto op_b2 = linear_operator(a.block(2, 2)); - auto op_b = - block_diagonal_operator<3, BlockVector>({op_b0, op_b1, op_b2}); + + std::array temp{op_b0, op_b1, op_b2}; + auto op_b = block_diagonal_operator<3, BlockVector>(temp); // vmult: @@ -152,7 +153,8 @@ int main() // And finally the other block_diagonal_operator variant: - auto op_c = block_diagonal_operator<5, BlockVector>({op_b0, op_b0, op_b0, op_b0, op_b0}); + std::array temp2{op_b0, op_b0, op_b0, op_b0, op_b0}; + auto op_c = block_diagonal_operator<5, BlockVector>(temp2); auto op_d = block_diagonal_operator<5, BlockVector>(op_b0);