gcc/testsuite/g++.dg/cpp23/explicit-obj-ops-mem-assignment.C
raw| 1 | // P0847R7 |
| 2 | // { dg-do compile { target c++23 } } |
| 3 | |
| 4 | // uses of member only operators (assignment) |
| 5 | |
| 6 | struct S { |
| 7 | void operator=(this S&, int) {} |
| 8 | }; |
| 9 | |
| 10 | void non_dep() |
| 11 | { |
| 12 | S s{}; |
| 13 | s = 0; |
| 14 | } |
| 15 | |
| 16 | template<typename = void> |
| 17 | void dependent() |
| 18 | { |
| 19 | S s{}; |
| 20 | s = 0; |
| 21 | } |
| 22 | |
| 23 | void call() |
| 24 | { |
| 25 | dependent(); |
| 26 | } |
| 27 |