From b04e02d077cf9f6fbf744319a464c1e447caa81f Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Tue, 9 Oct 2018 11:00:57 -0500 Subject: [PATCH] Tests: base/utilities_13.cc - workaround for clang Clang issues a spurious arithmetic exception if this code snippet is called with a reference long double pointing into the vector. Work around this issue by explicitly writing out the long double twice. --- tests/base/utilities_13.cc | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tests/base/utilities_13.cc b/tests/base/utilities_13.cc index 10fa8b65b9..5f6f3ed93e 100644 --- a/tests/base/utilities_13.cc +++ b/tests/base/utilities_13.cc @@ -113,12 +113,17 @@ test3() ((Integer)1 << min_bits) - 1); // make sure conversion is within bounds: - const std::vector points = {0.2, 0.7}; - for (const auto &v : points) - { - const Integer i = (Integer)(v * (Number)max); - Assert(i > 0 && i < max, ExcInternalError()); - } + { + const Number v = 0.2; + const Integer i = (Integer)(v * (Number)max); + Assert(i > 0 && i < max, ExcInternalError()); + } + + { + const Number v = 0.7; + const Integer i = (Integer)(v * (Number)max); + Assert(i > 0 && i < max, ExcInternalError()); + } { const Number v = 0.; -- 2.39.5