We are currently in the process of formatting our code base with clang-format. We found a situation where for some reason the stream operator to std::cout is moved to the next line if two consecutive strings literals are present. Putting a variable in between thw two string literals causes clang-format to not change the format. What needs to be changed in the .clang-format file to avoid this?
int main()
{
std::cout << "something" << "something" << std::endl;
}
becomes
int main()
{
std::cout << "something"
<< "something" << std::endl;
}
while
int main()
{
int a = 0;
std::cout << "something" << a << "something" << std::endl;
}
stays untouched. Note while this last snippet is wider, it is not split across multiple lines, while the shorter snippet above is.
This is with LLVM 9.0.0 Windows installer and is reproducible with the default config file.