point: work around GCC ICE in test case

GCC experiences an ICE when comparing the components of a redim'd to
lower dimension point. The test case is too complex to reasonably reduce
and submit for fixing/workaround so we add a bit more explicit work here
for this test case only.
This commit is contained in:
Danny Robson 2017-06-13 14:19:27 +10:00
parent 089caff53e
commit 2bc7e3e449

View File

@ -13,24 +13,22 @@ main (void)
// Redim to lower dimension
{
const point3f p(0.f, 1.f, 2.f);
const point3f p { 0.f, 1.f, 2.f };
const point2f q = p.redim<2> ();
const point2f r { 0.f, 1.f };
tap.expect (
almost_equal (q[0], p[0]) &&
almost_equal (q[1], p[1]),
"redim to lower dimension"
);
tap.expect_eq (q, r, "redim to lower dimension");
}
// Redim to higher dimension without fill
{
const point2f p(0.f, 1.f);
const point3f q = p.redim<3> ();
const point2f q = p.redim<2> ();
// GCC: we can't use the equality operator here because it triggers
// an ICE on GCC 7.1.0
tap.expect (
almost_equal (p[0], q[0]) &&
almost_equal (p[1], q[1]),
std::equal (std::cbegin (p), std::cend (p), std::cbegin (q)),
"redim to higher dimension"
);
}