| Issue |
76740
|
| Summary |
[Clang Tidy] performance-avoid-endl converts std::endl to '\n' even when preceded by another constant string
|
| Labels |
clang
|
| Assignees |
|
| Reporter |
battre
|
`clang-tidy -checks=performance-avoid-endl -fix` converts `std::endl` to `'\n'` even when preceded by another constant string.
# Minimum Test case:
```
#include <iostream>
void foo() {
std::cerr << "Hello World!" << std::endl;
}
```
# Observed behavior
After running `clang-tidy -checks=performance-avoid-endl -fix main.cc` the file looks as follows:
```
#include <iostream>
void foo() {
std::cerr << "Hello World!" << '\n';
}
```
# Expected output
I think it would make sense to generate
```
#include <iostream>
void foo() {
std::cerr << "Hello World!\n";
}
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs