Refactor ix86_expand_vecop_qihi2.
[gcc.git] / libstdc++-v3 / testsuite / 23_containers / vector / data_access / constexpr.cc
blob142050e8f03a40e3e1ae93426b26d9988dcf2d66
1 // { dg-do compile { target c++20 } }
3 #include <vector>
4 #include <testsuite_hooks.h>
6 constexpr bool
7 test_data()
9 std::vector<int> v;
10 VERIFY( v.data() == nullptr );
11 v.reserve(1);
12 VERIFY( v.data() != nullptr );
13 const std::vector<int> v2{1,3,5,9};
14 VERIFY( v.data() != v2.data() );
15 VERIFY( v2.data()[2] == 5 );
17 v = v2;
18 VERIFY( v.data() != v2.data() );
19 VERIFY( v.data()[1] == 3 );
21 return true;
24 static_assert(test_data());