mikecrowe wrote:

Unfortunately, walking the format string looking for macros also seems to match 
a macro that encloses the whole function invocation. This results in the check 
failing to work on expressions inside Catch2 `REQUIRE` macros for example.

My new test case (that currently fails) is:
```c++
#define SURROUND(x) x
  SURROUND(printf("Surrounding macro %d\n", 42));
  // CHECK-MESSAGES: [[@LINE-1]]:3: warning: use 'std::println' instead of 
'printf' [modernize-use-std-print]
  // CHECK-FIXES: std::print("Surrounding macro {}", 42);
```
I'll try to fix this, but any advice is gratefully received.

https://github.com/llvm/llvm-project/pull/97911
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to