AMS21 added a comment.

This check is mostly working. Added notes about problems I know about.



================
Comment at: clang-tools-extra/clang-tidy/performance/DontUseEndlCheck.cpp:44
+  Diag << FixItHint::CreateReplacement(
+      CharSourceRange::getCharRange(EndlCall->getSourceRange()), "'\\n'");
+}
----------------
This doesn't quite work and I'm not sure why or what would work. Any help would 
be appreciated.

Report for this like
```cpp
std::cout << std::endl;
```
looks like this:
```
  std::cout << std::endl;
               ^~~~~
               '\n'
```

So the start location is correct but the end is not.


================
Comment at: 
clang-tools-extra/test/clang-tidy/checkers/performance/dont-use-endl.cpp:45-71
+void bad() {
+  std::cout << "World" << std::endl;
+  // CHECK-MESSAGES: :[[@LINE-1]]:27: warning: do not use std::endl with 
iostreams; use '\n' instead
+  std::cerr << "World" << std::endl;
+  // CHECK-MESSAGES: :[[@LINE-1]]:27: warning: do not use std::endl with 
iostreams; use '\n' instead
+}
+
----------------
All these test are missing checks for the fixit. See comment above why they are 
missing.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148318/new/

https://reviews.llvm.org/D148318

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to