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