Skip to content

Commit e0c9019

Browse files
committed
test: regenerate results
1 parent 5b6e1fd commit e0c9019

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

regression-tests/test-results/pure2-enum.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ inline CPP2_CONSTEXPR file_attributes file_attributes::none = 0;
229229
if (((*this) & current) == current) {_ret += _comma + "current";_comma = ", ";}
230230
if (((*this) & obsolete) == obsolete) {_ret += _comma + "obsolete";_comma = ", ";}
231231
if (((*this) & cached_and_current) == cached_and_current) {_ret += _comma + "cached_and_current";_comma = ", ";}
232-
return _ret + ")";
232+
return std::move(_ret) + ")";
233233
}
234234
#line 28 "pure2-enum.cpp2"
235235
auto main() -> int{

regression-tests/test-results/pure2-union.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,21 +88,21 @@ auto main() -> int;
8888
[[nodiscard]] auto name_or_number::name() & -> std::string& {
8989
cpp2::Default.expects(is_name(), "");return *cpp2::assert_not_null(reinterpret_cast<std::string*>(&_storage)); }
9090
auto name_or_number::set_name(cpp2::in<std::string> _value) & -> void{if (!(is_name())) {_destroy();std::construct_at(reinterpret_cast<std::string*>(&_storage), _value);}else {*cpp2::assert_not_null(reinterpret_cast<std::string*>(&_storage)) = _value;}_discriminator = 0;}
91-
auto name_or_number::set_name(auto&& ..._args) & -> void{if (!(is_name())) {_destroy();std::construct_at(reinterpret_cast<std::string*>(&_storage), _args...);}else {*cpp2::assert_not_null(reinterpret_cast<std::string*>(&_storage)) = std::string{_args...};}_discriminator = 0;}
91+
auto name_or_number::set_name(auto&& ..._args) & -> void{if (!(is_name())) {_destroy();std::construct_at(reinterpret_cast<std::string*>(&_storage), CPP2_FORWARD(_args)...);}else {*cpp2::assert_not_null(reinterpret_cast<std::string*>(&_storage)) = std::string{CPP2_FORWARD(_args)...};}_discriminator = 0;}
9292
[[nodiscard]] auto name_or_number::is_num() const& -> bool { return _discriminator == 1; }
9393
[[nodiscard]] auto name_or_number::num() const& -> cpp2::i32 const& {
9494
cpp2::Default.expects(is_num(), "");return *cpp2::assert_not_null(reinterpret_cast<cpp2::i32 const*>(&_storage)); }
9595
[[nodiscard]] auto name_or_number::num() & -> cpp2::i32& {
9696
cpp2::Default.expects(is_num(), "");return *cpp2::assert_not_null(reinterpret_cast<cpp2::i32*>(&_storage)); }
9797
auto name_or_number::set_num(cpp2::in<cpp2::i32> _value) & -> void{if (!(is_num())) {_destroy();std::construct_at(reinterpret_cast<cpp2::i32*>(&_storage), _value);}else {*cpp2::assert_not_null(reinterpret_cast<cpp2::i32*>(&_storage)) = _value;}_discriminator = 1;}
98-
auto name_or_number::set_num(auto&& ..._args) & -> void{if (!(is_num())) {_destroy();std::construct_at(reinterpret_cast<cpp2::i32*>(&_storage), _args...);}else {*cpp2::assert_not_null(reinterpret_cast<cpp2::i32*>(&_storage)) = cpp2::i32{_args...};}_discriminator = 1;}
98+
auto name_or_number::set_num(auto&& ..._args) & -> void{if (!(is_num())) {_destroy();std::construct_at(reinterpret_cast<cpp2::i32*>(&_storage), CPP2_FORWARD(_args)...);}else {*cpp2::assert_not_null(reinterpret_cast<cpp2::i32*>(&_storage)) = cpp2::i32{CPP2_FORWARD(_args)...};}_discriminator = 1;}
9999
auto name_or_number::_destroy() & -> void{
100100
if (_discriminator == 0) {std::destroy_at(reinterpret_cast<std::string*>(&_storage));}
101101
if (_discriminator == 1) {std::destroy_at(reinterpret_cast<cpp2::i32*>(&_storage));}
102102
_discriminator = -1;
103103
}
104104

105-
name_or_number::~name_or_number() noexcept{_destroy();}
105+
name_or_number::~name_or_number() noexcept{CPP2_UFCS(_destroy)((*this));static_cast<void>(std::move((*this)));}
106106
name_or_number::name_or_number(){}
107107
name_or_number::name_or_number(name_or_number const& that)
108108
: _storage{ }
@@ -144,21 +144,21 @@ template <typename T> [[nodiscard]] auto name_or_other<T>::name() const& -> std:
144144
template <typename T> [[nodiscard]] auto name_or_other<T>::name() & -> std::string& {
145145
cpp2::Default.expects(is_name(), "");return *cpp2::assert_not_null(reinterpret_cast<std::string*>(&_storage)); }
146146
template <typename T> auto name_or_other<T>::set_name(cpp2::in<std::string> _value) & -> void{if (!(is_name())) {_destroy();std::construct_at(reinterpret_cast<std::string*>(&_storage), _value);}else {*cpp2::assert_not_null(reinterpret_cast<std::string*>(&_storage)) = _value;}_discriminator = 0;}
147-
template <typename T> auto name_or_other<T>::set_name(auto&& ..._args) & -> void{if (!(is_name())) {_destroy();std::construct_at(reinterpret_cast<std::string*>(&_storage), _args...);}else {*cpp2::assert_not_null(reinterpret_cast<std::string*>(&_storage)) = std::string{_args...};}_discriminator = 0;}
147+
template <typename T> auto name_or_other<T>::set_name(auto&& ..._args) & -> void{if (!(is_name())) {_destroy();std::construct_at(reinterpret_cast<std::string*>(&_storage), CPP2_FORWARD(_args)...);}else {*cpp2::assert_not_null(reinterpret_cast<std::string*>(&_storage)) = std::string{CPP2_FORWARD(_args)...};}_discriminator = 0;}
148148
template <typename T> [[nodiscard]] auto name_or_other<T>::is_other() const& -> bool { return _discriminator == 1; }
149149
template <typename T> [[nodiscard]] auto name_or_other<T>::other() const& -> T const& {
150150
cpp2::Default.expects(is_other(), "");return *cpp2::assert_not_null(reinterpret_cast<T const*>(&_storage)); }
151151
template <typename T> [[nodiscard]] auto name_or_other<T>::other() & -> T& {
152152
cpp2::Default.expects(is_other(), "");return *cpp2::assert_not_null(reinterpret_cast<T*>(&_storage)); }
153153
template <typename T> auto name_or_other<T>::set_other(cpp2::in<T> _value) & -> void{if (!(is_other())) {_destroy();std::construct_at(reinterpret_cast<T*>(&_storage), _value);}else {*cpp2::assert_not_null(reinterpret_cast<T*>(&_storage)) = _value;}_discriminator = 1;}
154-
template <typename T> auto name_or_other<T>::set_other(auto&& ..._args) & -> void{if (!(is_other())) {_destroy();std::construct_at(reinterpret_cast<T*>(&_storage), _args...);}else {*cpp2::assert_not_null(reinterpret_cast<T*>(&_storage)) = T{_args...};}_discriminator = 1;}
154+
template <typename T> auto name_or_other<T>::set_other(auto&& ..._args) & -> void{if (!(is_other())) {_destroy();std::construct_at(reinterpret_cast<T*>(&_storage), CPP2_FORWARD(_args)...);}else {*cpp2::assert_not_null(reinterpret_cast<T*>(&_storage)) = T{CPP2_FORWARD(_args)...};}_discriminator = 1;}
155155
template <typename T> auto name_or_other<T>::_destroy() & -> void{
156156
if (_discriminator == 0) {std::destroy_at(reinterpret_cast<std::string*>(&_storage));}
157157
if (_discriminator == 1) {std::destroy_at(reinterpret_cast<T*>(&_storage));}
158158
_discriminator = -1;
159159
}
160160

161-
template <typename T> name_or_other<T>::~name_or_other() noexcept{_destroy();}
161+
template <typename T> name_or_other<T>::~name_or_other() noexcept{CPP2_UFCS(_destroy)((*this));static_cast<void>(std::move((*this)));}
162162
template <typename T> name_or_other<T>::name_or_other(){}
163163
template <typename T> name_or_other<T>::name_or_other(name_or_other const& that)
164164
: _storage{ }

0 commit comments

Comments
 (0)