From e88a7faa61173f0f02fde94b5f4034532a1f4ed4 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Wed, 27 May 2015 12:53:58 +0200 Subject: [PATCH] Workaround for a regression in <=gcc-4.7 with partial template default values --- include/deal.II/lac/linear_operator.h | 35 ++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/include/deal.II/lac/linear_operator.h b/include/deal.II/lac/linear_operator.h index 834f7934de..ce1145ebd0 100644 --- a/include/deal.II/lac/linear_operator.h +++ b/include/deal.II/lac/linear_operator.h @@ -2143,10 +2143,19 @@ operator*(const PackagedOperation &comp, * * @ingroup LAOperators */ + +// workaround for a bug in <=gcc-4.7 that does not like partial template +// default values in combination with local lambda expressions [1] +// [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53624 template , typename Domain = Range, typename BlockMatrix> LinearOperator +lower_triangular_operator(const BlockMatrix &); + + +template +LinearOperator lower_triangular_operator(const BlockMatrix &block_matrix) { Assert( block_matrix.n_block_rows() == block_matrix.n_block_cols(), @@ -2258,10 +2267,19 @@ lower_triangular_operator(const BlockMatrix &block_matrix) * * @ingroup LAOperators */ + +// workaround for a bug in <=gcc-4.7 that does not like partial template +// default values in combination with local lambda expressions [1] +// [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53624 template , typename Domain = Range, typename BlockMatrix> LinearOperator +upper_triangular_operator(const BlockMatrix &); + + +template +LinearOperator upper_triangular_operator(const BlockMatrix &block_matrix) { Assert( block_matrix.n_block_rows() == block_matrix.n_block_cols(), @@ -2378,13 +2396,24 @@ upper_triangular_operator(const BlockMatrix &block_matrix) * to use upper triangular part of @p block_matrix (false). * @ingroup LAOperators */ + +// workaround for a bug in <=gcc-4.7 that does not like partial template +// default values in combination with local lambda expressions [1] +// [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53624 template , typename Domain = Range, typename BlockMatrix> LinearOperator -block_triangular_inverse( const BlockMatrix &block_matrix, - const LinearOperator &inverse_diagonal, - bool lower = true) +block_triangular_inverse(const BlockMatrix &, + const LinearOperator &, + bool lower = true); + + +template +LinearOperator +block_triangular_inverse(const BlockMatrix &block_matrix, + const LinearOperator &inverse_diagonal, + bool lower) { Assert( block_matrix.n_block_rows() == block_matrix.n_block_cols(), ExcDimensionMismatch(block_matrix.n_block_rows(),block_matrix.n_block_cols()) ); -- 2.39.5