From 197cb40c92db95ebf2c3a657b783ca543899ac4c Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Thu, 31 Jan 2019 23:47:38 +0100 Subject: [PATCH] Be explicit about initialization of static const Tensor variables --- include/deal.II/base/patterns.h | 2 +- include/deal.II/base/tensor_function.templates.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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; -- 2.39.5