From: Matthias Maier Date: Tue, 9 Oct 2018 16:00:57 +0000 (-0500) Subject: Tests: base/utilities_13.cc - workaround for clang X-Git-Tag: v9.1.0-rc1~647^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b04e02d077cf9f6fbf744319a464c1e447caa81f;p=dealii.git 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. --- 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.;