Created attachment 23838
3 files: (1) the dummy test file (2) .clang-format for v10 (3) .clang-format
for v6
Version:
clang-format version 10.0.0-4ubuntu1~18.04.2
Overview:
Continuation of long lines seem to align with the start of line instead of
start of instruction. This behaviour did not exist in clang-format-6.0.
Steps to reproduce:
Run clang-format with ColumnLimit of 120 and ContinuationIndentWidth of 2 on
this snippet (also attached).
void foo()
{
if (SUCCESS_CONSTANT
== a_really_really_really_long_function_name(
reinterpret_cast<uint8_t*>(a_somewhat_long_argument), a_somewhat_long_argument,
reinterpret_cast<uint16_t*>(a_really_really_really_really_really_long_argument),
reinterpret_cast<uint32_t*>(a_really_really_really_really_really_long_argument)))
{
// do stuff
}
}
Expected Result (what I got with clang-format-6.0):
void foo()
{
if (SUCCESS_CONSTANT
== a_really_really_really_long_function_name(
reinterpret_cast<uint8_t*>(a_somewhat_long_argument), a_somewhat_long_argument,
reinterpret_cast<uint16_t*>(a_really_really_really_really_really_long_argument),
reinterpret_cast<uint32_t*>(a_really_really_really_really_really_long_argument)))
{
// do stuff
}
}
Actual Result (what I got with clang-format-10):
void foo()
{
if (SUCCESS_CONSTANT
== a_really_really_really_long_function_name(
reinterpret_cast<uint8_t*>(a_somewhat_long_argument), a_somewhat_long_argument,
reinterpret_cast<uint16_t*>(a_really_really_really_really_really_long_argument),
reinterpret_cast<uint32_t*>(a_really_really_really_really_really_long_argument)))
{
// do stuff
}
}
Notice how the continued line is aligned to the left of the function name. I
tried tweaking many other rules but did not seem to help. This led me to
believe that the alignment reference for long line continuation has been
changed from "start of instruction" to "start of line"
bugreport.zip
(2930 bytes, application/zip)