Skip to content

Commit fb03ce7

Browse files
authored
[libc++] Fix test for vector data_const.pass.cpp (#122085)
The test contained some non-const accesses when we're really trying to test that the method is const.
1 parent 17912f3 commit fb03ce7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libcxx/test/std/containers/sequences/vector/vector.data/data_const.pass.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ TEST_CONSTEXPR_CXX20 bool tests()
3939
assert(is_contiguous_container_asan_correct(v));
4040
}
4141
{
42-
std::vector<Nasty> v(100);
42+
const std::vector<Nasty> v(100);
4343
assert(v.data() == std::addressof(v.front()));
4444
assert(is_contiguous_container_asan_correct(v));
4545
}
@@ -55,7 +55,7 @@ TEST_CONSTEXPR_CXX20 bool tests()
5555
assert(is_contiguous_container_asan_correct(v));
5656
}
5757
{
58-
std::vector<Nasty, min_allocator<Nasty>> v(100);
58+
const std::vector<Nasty, min_allocator<Nasty>> v(100);
5959
assert(v.data() == std::addressof(v.front()));
6060
assert(is_contiguous_container_asan_correct(v));
6161
}
@@ -70,7 +70,7 @@ TEST_CONSTEXPR_CXX20 bool tests()
7070
assert(is_contiguous_container_asan_correct(v));
7171
}
7272
{
73-
std::vector<Nasty, safe_allocator<Nasty>> v(100);
73+
const std::vector<Nasty, safe_allocator<Nasty>> v(100);
7474
assert(v.data() == std::addressof(v.front()));
7575
assert(is_contiguous_container_asan_correct(v));
7676
}

0 commit comments

Comments
 (0)