This check flags uses of std::endl on streams and suggests using the newline character '\n' instead. std::endl performs two operations: it writes a newline character to the output stream and then flushes the stream buffer, which can be less efficient than writing a single newline character using '\n'.
This fixes llvm#35321
Why are you matching on ends.
That manipulator just inserts a null character to the stream(akin to doing std::cout << '\0';)
More to the point changing replacing this call with std::cout << '\n' changes behaviour and will likely cause UB as this modifier is meant for null-terminating character buffers to pass to C functions.
Double side note the point I made before about how you can turn << "World" << endl into << "World\n" also wouldn't work here as << "World\0" does the same thing as << "World" due to "World" already being a null terminated string.