Skip to content

Commit 7d72130

Browse files
committed
refactor(reflect): restore implicit this access
1 parent 88591bb commit 7d72130

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

regression-tests/test-results/pure2-last-use.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ auto issue_869::_destroy() & -> void{
321321
_discriminator = -1;
322322
}
323323

324-
issue_869::~issue_869() noexcept{CPP2_UFCS(_destroy)((*this));static_cast<void>(std::move((*this)));}
324+
issue_869::~issue_869() noexcept{_destroy();static_cast<void>(std::move((*this)));}
325325
issue_869::issue_869(){}
326326
issue_869::issue_869(issue_869 const& that)
327327
: _storage{ }

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ if (_discriminator == 1) {std::destroy_at(reinterpret_cast<cpp2::i32*>(&_storage
102102
_discriminator = -1;
103103
}
104104

105-
name_or_number::~name_or_number() noexcept{CPP2_UFCS(_destroy)((*this));static_cast<void>(std::move((*this)));}
105+
name_or_number::~name_or_number() noexcept{_destroy();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{ }
@@ -158,7 +158,7 @@ template <typename T> auto name_or_other<T>::_destroy() & -> void{
158158
_discriminator = -1;
159159
}
160160

161-
template <typename T> name_or_other<T>::~name_or_other() noexcept{CPP2_UFCS(_destroy)((*this));static_cast<void>(std::move((*this)));}
161+
template <typename T> name_or_other<T>::~name_or_other() noexcept{_destroy();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{ }

source/reflect.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1682,7 +1682,7 @@ std::string destroy = " private _destroy: (inout this) = {\n";
16821682

16831683
// Add the destructor
16841684
#line 1199 "reflect.h2"
1685-
CPP2_UFCS(add_member)(t, " operator=: (move this) = { this._destroy(); _ = this; }");
1685+
CPP2_UFCS(add_member)(t, " operator=: (move this) = { _destroy(); _ = this; }");
16861686

16871687
// Add default constructor
16881688
CPP2_UFCS(add_member)(t, " operator=: (out this) = { }");

source/reflect.h2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1196,7 +1196,7 @@ union: (inout t : meta::type_declaration)
11961196
}
11971197

11981198
// Add the destructor
1199-
t.add_member( " operator=: (move this) = { this._destroy(); _ = this; }" );
1199+
t.add_member( " operator=: (move this) = { _destroy(); _ = this; }" );
12001200

12011201
// Add default constructor
12021202
t.add_member( " operator=: (out this) = { }" );

0 commit comments

Comments
 (0)