This is an automated email from the ASF dual-hosted git repository.
tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm-ffi.git
The following commit(s) were added to refs/heads/main by this push:
new 1a9c137f [TEST] Avoid GCC ICE in tuple move test (#865)
1a9c137f is described below
commit 1a9c137f7f8b0f2173c8cda5f6767cfd82eb377d
Author: Tianqi Chen <[email protected]>
AuthorDate: Thu Oct 22 09:41:15 2026 -0400
[TEST] Avoid GCC ICE in tuple move test (#865)
Spell out the tuple move and rvalue element extraction to avoid a GCC
15.2 structured-binding compiler error while preserving the ownership
assertions.
---
tests/cpp/test_tuple.cc | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/tests/cpp/test_tuple.cc b/tests/cpp/test_tuple.cc
index 9aeb57c8..331ca3ab 100644
--- a/tests/cpp/test_tuple.cc
+++ b/tests/cpp/test_tuple.cc
@@ -195,9 +195,10 @@ TEST(Tuple, CPPFeatures) {
{
auto p = Tuple{Array<int>{0}};
EXPECT_EQ(p.use_count(), 1);
- // structured binding (rvalue)
- // move out the only ownership
- auto [q] = std::move(p);
+ // Spell out the tuple move and rvalue get to avoid a GCC 15.2
structured-binding ICE.
+ // Move out the only ownership.
+ auto moved = std::move(p);
+ auto q = get<0>(std::move(moved));
EXPECT_EQ(q.use_count(), 1);
}