Skip to content

Commit 3e3ab8d

Browse files
committed
guard p1061 structured bindings behind FTM, add structured binding test case
1 parent a7ed542 commit 3e3ab8d

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

libcxx/test/std/utilities/intseq/intseq.binding/structured_binding.pass.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,18 @@
2020
#include <cassert>
2121
#include <utility>
2222

23-
template <typename...>
2423
void test_structured_bindings() {
24+
auto [elt0, elt1, elt2, elt3] = std::make_index_sequence<4>();
25+
26+
assert(elt0 == 0);
27+
assert(elt1 == 1);
28+
assert(elt2 == 2);
29+
assert(elt3 == 3);
30+
}
31+
32+
#if __cpp_structured_bindings >= 202411L
33+
template <typename...>
34+
void test_p1061_structured_bindings() {
2535
auto [... empty] = std::make_index_sequence<0>();
2636
static_assert(sizeof...(empty) == 0);
2737

@@ -33,8 +43,12 @@ void test_structured_bindings() {
3343
assert(size4...[2] == 2);
3444
assert(size4...[3] == 3);
3545
}
46+
#endif
3647

3748
int main(int, char**) {
3849
test_structured_bindings();
50+
#if __cpp_structured_bindings >= 202411L
51+
test_p1061_structured_bindings();
52+
#endif
3953
return 0;
4054
}

0 commit comments

Comments
 (0)