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