Open battre opened 10 months ago
clang-tidy -checks=performance-avoid-endl -fix converts std::endl to '\n' even when preceded by another constant string.
clang-tidy -checks=performance-avoid-endl -fix
std::endl
'\n'
#include <iostream> void foo() { std::cerr << "Hello World!" << std::endl; }
After running clang-tidy -checks=performance-avoid-endl -fix main.cc the file looks as follows:
clang-tidy -checks=performance-avoid-endl -fix main.cc
#include <iostream> void foo() { std::cerr << "Hello World!" << '\n'; }
I think it would make sense to generate
#include <iostream> void foo() { std::cerr << "Hello World!\n"; }
@llvm/issue-subscribers-clang-tidy
Author: Dominic Battre (battre)
It would make sense, but check works as documented.
clang-tidy -checks=performance-avoid-endl -fix
convertsstd::endl
to'\n'
even when preceded by another constant string.Minimum Test case:
Observed behavior
After running
clang-tidy -checks=performance-avoid-endl -fix main.cc
the file looks as follows:Expected output
I think it would make sense to generate