-
- Downloads
c++: P0847R7 (deducing this) - CWG2586 [PR102609]
This adds support for defaulted comparison operators and copy/move
assignment operators, as well as allowing user defined xobj copy/move
assignment operators. It turns out defaulted comparison operators already
worked though, so this just adds a test for them. Defaulted comparison
operators were not so nice and required a bit of a hack. Should work fine
though!
The diagnostics leave something to be desired, and there are some things
that could be improved with more extensive design changes. There are a few
notes left indicating where I think we could make improvements.
Aside from some small bugs, with this commit xobj member functions should be
feature complete.
PR c++/102609
gcc/cp/ChangeLog:
PR c++/102609
C++23 P0847R7 (deducing this) - CWG2586.
* decl.cc (copy_fn_p): Accept xobj copy assignment functions.
(move_signature_fn_p): Accept xobj move assignment functions.
* method.cc (do_build_copy_assign): Handle defaulted xobj member
functions.
(defaulted_late_check): Comment.
(defaultable_fn_check): Comment.
gcc/testsuite/ChangeLog:
PR c++/102609
C++23 P0847R7 (deducing this) - CWG2586.
* g++.dg/cpp23/explicit-obj-basic6.C: New test.
* g++.dg/cpp23/explicit-obj-default1.C: New test.
* g++.dg/cpp23/explicit-obj-default2.C: New test.
Signed-off-by:
Waffl3x <waffl3x@protonmail.com>
Showing
- gcc/cp/decl.cc 26 additions, 2 deletionsgcc/cp/decl.cc
- gcc/cp/method.cc 49 additions, 6 deletionsgcc/cp/method.cc
- gcc/testsuite/g++.dg/cpp23/explicit-obj-basic6.C 51 additions, 0 deletionsgcc/testsuite/g++.dg/cpp23/explicit-obj-basic6.C
- gcc/testsuite/g++.dg/cpp23/explicit-obj-default1.C 57 additions, 0 deletionsgcc/testsuite/g++.dg/cpp23/explicit-obj-default1.C
- gcc/testsuite/g++.dg/cpp23/explicit-obj-default2.C 65 additions, 0 deletionsgcc/testsuite/g++.dg/cpp23/explicit-obj-default2.C
Loading
Please register or sign in to comment