[clang-tools-extra] [clang-tidy] Fix false positives with deducing this in `readability-convert-member-functions-to-static` check (PR #141391)

via cfe-commits cfe-commits at lists.llvm.org
Sun May 25 00:18:15 PDT 2025


================
@@ -0,0 +1,14 @@
+// RUN: %check_clang_tidy -std=c++23 %s readability-convert-member-functions-to-static %t
+
+namespace std{
+  class string {};
+  void println(const char *format, const std::string &str) {}
+}
+
+namespace PR141381 {
+struct Hello {
+  std::string str_;
+
+  void hello(this Hello &self) { std::println("Hello, {0}!", self.str_); }
----------------
flovent wrote:

testcases added.

https://github.com/llvm/llvm-project/pull/141391


More information about the cfe-commits mailing list