From 428e5c683d2fc1931d1f6c9c60e2d0825f2cc92b Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Tue, 6 Aug 2024 14:49:36 +1000 Subject: [PATCH] kmeans: work around an ICE in clang-19 tests --- test/kmeans.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/kmeans.cpp b/test/kmeans.cpp index 6217fefb..0dd89651 100644 --- a/test/kmeans.cpp +++ b/test/kmeans.cpp @@ -17,7 +17,15 @@ main () std::array q; cruft::kmeans (cruft::view{p}, cruft::view{q}); - tap.expect_eq (p, q, "single point, single k"); + // clang#19-rc2: ICE when instantiating p == q + // + // clang++-19: clang/include/clang/AST/DeclTemplate.h:1938: + // void clang::ClassTemplateSpecializationDecl::setPointOfInstantiation(clang::SourceLocation): + // Assertion `Loc.isValid() && "point of instantiation must be valid!"' failed. + // + // So just compare the items directly. + static_assert (p.size () == q.size ()); + tap.expect_eq (p[0], q[0], "single point, single k"); } // create two vectors, check if the mean converges to their average