brintos

brintos / llvm-project-archived public Read only

0
0
Text · 619 B · 7974301 Raw
23 lines · cpp
1// RUN: %check_clang_tidy -std=c++23-or-later %s readability-convert-member-functions-to-static %t2 3namespace std{4  class string {};5  void println(const char *format, const std::string &str) {}6}7 8struct Hello {9  std::string str_;10 11  void ByValueSelf(this Hello self) { std::println("Hello, {0}!", self.str_); }12 13  void ByLRefSelf(this Hello &self) { std::println("Hello, {0}!", 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