From: Daniel Arndt Date: Thu, 31 Jan 2019 22:47:38 +0000 (+0100) Subject: Be explicit about initialization of static const Tensor variables X-Git-Tag: v9.1.0-rc1~383^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=197cb40c92db95ebf2c3a657b783ca543899ac4c;p=dealii.git Be explicit about initialization of static const Tensor variables --- diff --git a/include/deal.II/base/patterns.h b/include/deal.II/base/patterns.h index 2789bf8434..d4ea6babc0 100644 --- a/include/deal.II/base/patterns.h +++ b/include/deal.II/base/patterns.h @@ -1521,7 +1521,7 @@ namespace Patterns std::is_same::value || std::is_same::value) str << static_cast(value); else if (std::is_same::value) - str << (value ? "true" : "false"); + str << (static_cast(value) ? "true" : "false"); else str << value; AssertThrow(p->match(str.str()), ExcNoMatch(str.str(), p.get())); diff --git a/include/deal.II/base/tensor_function.templates.h b/include/deal.II/base/tensor_function.templates.h index cb53e448c1..d760d22070 100644 --- a/include/deal.II/base/tensor_function.templates.h +++ b/include/deal.II/base/tensor_function.templates.h @@ -123,7 +123,7 @@ template typename TensorFunction::gradient_type ConstantTensorFunction::gradient(const Point &) const { - static const Tensor zero; + static const Tensor zero{}; return zero; } @@ -140,7 +140,7 @@ ConstantTensorFunction::gradient_list( Assert(gradients.size() == points.size(), ExcDimensionMismatch(gradients.size(), points.size())); - static const Tensor zero; + static const Tensor zero{}; for (unsigned int i = 0; i < gradients.size(); ++i) gradients[i] = zero;