|
7 | 7 | #include "cpp2util.h" |
8 | 8 |
|
9 | 9 |
|
| 10 | +#line 3 "pure2-bugfix-for-assign-expression-list.cpp2" |
| 11 | +class my_vec; |
| 12 | + |
10 | 13 |
|
11 | 14 | //=== Cpp2 type definitions and function declarations =========================== |
12 | 15 |
|
13 | | -auto main() -> int; |
| 16 | +using vec = std::vector<int>; |
| 17 | + |
| 18 | +class my_vec { |
| 19 | + private: vec v {}; |
| 20 | + public: explicit my_vec([[maybe_unused]] cpp2::in<std::integral_constant<int,0>> param2); |
14 | 21 |
|
| 22 | +#line 5 "pure2-bugfix-for-assign-expression-list.cpp2" |
| 23 | + public: auto operator=([[maybe_unused]] cpp2::in<std::integral_constant<int,0>> param2) -> my_vec& ; |
| 24 | + public: explicit my_vec([[maybe_unused]] cpp2::in<std::integral_constant<int,1>> param2); |
| 25 | + |
| 26 | +#line 6 "pure2-bugfix-for-assign-expression-list.cpp2" |
| 27 | + public: auto operator=([[maybe_unused]] cpp2::in<std::integral_constant<int,1>> param2) -> my_vec& ; |
| 28 | + public: explicit my_vec([[maybe_unused]] cpp2::in<std::integral_constant<int,2>> param2); |
| 29 | +#line 7 "pure2-bugfix-for-assign-expression-list.cpp2" |
| 30 | + public: auto operator=([[maybe_unused]] cpp2::in<std::integral_constant<int,2>> param2) -> my_vec& ; |
| 31 | + |
| 32 | + public: my_vec(my_vec const&) = delete; /* No 'that' constructor, suppress copy */ |
| 33 | + public: auto operator=(my_vec const&) -> void = delete; |
| 34 | +#line 8 "pure2-bugfix-for-assign-expression-list.cpp2" |
| 35 | +}; |
| 36 | + |
| 37 | +auto main() -> int; |
| 38 | + |
15 | 39 |
|
16 | 40 | //=== Cpp2 function definitions ================================================= |
17 | 41 |
|
| 42 | + |
| 43 | +#line 5 "pure2-bugfix-for-assign-expression-list.cpp2" |
| 44 | + my_vec::my_vec([[maybe_unused]] cpp2::in<std::integral_constant<int,0>> param2) |
| 45 | + : v{ } |
| 46 | +#line 5 "pure2-bugfix-for-assign-expression-list.cpp2" |
| 47 | + { } |
| 48 | +#line 5 "pure2-bugfix-for-assign-expression-list.cpp2" |
| 49 | + auto my_vec::operator=([[maybe_unused]] cpp2::in<std::integral_constant<int,0>> param2) -> my_vec& { |
| 50 | + v = { }; |
| 51 | + return *this; |
| 52 | +#line 5 "pure2-bugfix-for-assign-expression-list.cpp2" |
| 53 | + } |
| 54 | + my_vec::my_vec([[maybe_unused]] cpp2::in<std::integral_constant<int,1>> param2) |
| 55 | + : v{ 1 } |
| 56 | +#line 6 "pure2-bugfix-for-assign-expression-list.cpp2" |
| 57 | + { } |
| 58 | +#line 6 "pure2-bugfix-for-assign-expression-list.cpp2" |
| 59 | + auto my_vec::operator=([[maybe_unused]] cpp2::in<std::integral_constant<int,1>> param2) -> my_vec& { |
| 60 | + v = { 1 }; |
| 61 | + return *this; |
| 62 | +#line 6 "pure2-bugfix-for-assign-expression-list.cpp2" |
| 63 | + } |
| 64 | + my_vec::my_vec([[maybe_unused]] cpp2::in<std::integral_constant<int,2>> param2) |
| 65 | + : v{ 2, 3 } |
| 66 | +#line 7 "pure2-bugfix-for-assign-expression-list.cpp2" |
| 67 | + { } |
| 68 | +#line 7 "pure2-bugfix-for-assign-expression-list.cpp2" |
| 69 | + auto my_vec::operator=([[maybe_unused]] cpp2::in<std::integral_constant<int,2>> param2) -> my_vec& { |
| 70 | + v = { 2, 3 }; |
| 71 | + return *this; |
| 72 | +#line 7 "pure2-bugfix-for-assign-expression-list.cpp2" |
| 73 | + } |
| 74 | + |
| 75 | +#line 10 "pure2-bugfix-for-assign-expression-list.cpp2" |
18 | 76 | auto main() -> int{ |
19 | | - using vec = std::vector<int>; |
20 | 77 | vec v {0}; |
21 | 78 | v = { }; |
22 | 79 | cpp2::Default.expects(v == vec{}, ""); |
|
0 commit comments