gcc/testsuite/g++.dg/cpp2a/spaceship-rewrite4.C
raw| 1 | // { dg-do compile { target c++11 } } |
| 2 | |
| 3 | struct iterator; |
| 4 | struct const_iterator { |
| 5 | const_iterator(const iterator&); |
| 6 | bool operator==(const const_iterator &ci) const = delete; |
| 7 | }; |
| 8 | struct iterator { |
| 9 | bool operator==(const const_iterator &ci) const { |
| 10 | return ci == *this; // { dg-error "deleted" "" { target c++17_down } } |
| 11 | } // { dg-warning "reversed" "" { target c++20 } .-1 } |
| 12 | }; |