| 1 | // RUN: %check_clang_tidy -std=c++23-or-later %s readability-convert-member-functions-to-static %t |
| 2 | |
| 3 | namespace std{ |
| 4 | class string {}; |
| 5 | void println(const char *format, const std::string &str) {} |
| 6 | } |
| 7 | |
| 8 | struct Hello { |
| 9 | std::string str_; |
| 10 | |
| 11 | void ByValueSelf(this Hello self) { std::println(format: "Hello, {0}!" , str: self.str_); } |
| 12 | |
| 13 | void ByLRefSelf(this Hello &self) { std::println(format: "Hello, {0}!" , str: self.str_); } |
| 14 | |
| 15 | void ByRRefSelf(this Hello&& self) {} |
| 16 | |
| 17 | template<typename Self> void ByForwardRefSelf(this Self&& self) {} |
| 18 | |
| 19 | void MultiParam(this Hello &self, int a, double b) {} |
| 20 | |
| 21 | void UnnamedExplicitObjectParam(this Hello &) {} |
| 22 | }; |
| 23 | |