Skip to content

Commit ee2a7bc

Browse files
committed
[libc++] Add regression tests for issue llvm#46841
1 parent f106b3f commit ee2a7bc

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ TEST_CONSTEXPR_CXX20 void basic_test_cases() {
8989
test<std::vector<int, safe_allocator<int> > >(
9090
random_access_iterator<const int*>(a), random_access_iterator<const int*>(an));
9191
#endif
92+
93+
// Regression test for https://github.com/llvm/llvm-project/issues/46841
94+
{
95+
std::vector<int> v1({}, forward_iterator<const int*>{});
96+
std::vector<int> v2(forward_iterator<const int*>{}, {});
97+
}
9298
}
9399

94100
TEST_CONSTEXPR_CXX20 void emplaceable_concept_tests() {

libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter_alloc.pass.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,13 @@ TEST_CONSTEXPR_CXX20 void basic_tests() {
9898
test<std::vector<int, safe_allocator<int> > >(a, an, alloc);
9999
}
100100
#endif
101+
102+
// Regression test for https://github.com/llvm/llvm-project/issues/46841
103+
{
104+
min_allocator<int> alloc;
105+
std::vector<int, min_allocator<int> > v1({}, forward_iterator<const int*>{}, alloc);
106+
std::vector<int, min_allocator<int> > v2(forward_iterator<const int*>{}, {}, alloc);
107+
}
101108
}
102109

103110
TEST_CONSTEXPR_CXX20 void emplaceable_concept_tests() {

0 commit comments

Comments
 (0)