1#define COMPRESSED_PAIR_REV 2
2#include <libcxx-simulators-common/compressed_pair.h>
3
4namespace std {
5inline namespace __1 {
6template <typename T> struct vector {
7 T *__begin_;
8 T *__end_;
9 _LLDB_COMPRESSED_PAIR(T *, __cap_ = nullptr, void *, __alloc_);
10};
11} // namespace __1
12
13inline namespace __2 {
14template <typename T> struct vector {};
15} // namespace __2
16
17inline namespace __3 {
18template <typename T> struct vector {
19 T *__begin_;
20 T *__end_;
21 _LLDB_COMPRESSED_PAIR(short *, __cap_ = nullptr, void *, __alloc_);
22};
23} // namespace __3
24} // namespace std
25
26int main() {
27 int arr[] = {1, 2, 3};
28 std::__1::vector<int> v1{.__begin_ = arr, .__end_ = nullptr};
29 std::__1::vector<int> v2{.__begin_ = nullptr, .__end_ = arr};
30 std::__1::vector<int> v3{.__begin_ = &arr[2], .__end_ = arr};
31 std::__2::vector<int> v4;
32
33 char carr[] = {'a'};
34 std::__3::vector<char> v5{.__begin_ = carr, .__end_ = carr + 1};
35
36 return 0;
37}
38

Provided by KDAB

Privacy Policy
Update your C++ knowledge – Modern C++11/14/17 Training
Find out more

source code of lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/invalid-vector/main.cpp