clang-format Version: 13.0.
Description: AlignTrailingComments (?) behaves different for the following two input cases
Reproduction Steps: Format the following two blocks of input code (no whitespace at all before comments) with default settings (no .clang-format specified). Notice the different aligned trailing comment on #else with #endif when there is a newline at the end of the class definition.
I am curious why this is the case and also why it is not aligned with the initial if-PP. Also I would like to know how to set clang-format to not differentiate and either always align or not, regardless of a newline at the end of the definition (in this case).
clang-format Version: 13.0. Description: AlignTrailingComments (?) behaves different for the following two input cases
Reproduction Steps: Format the following two blocks of input code (no whitespace at all before comments) with default settings (no .clang-format specified). Notice the different aligned trailing comment on #else with #endif when there is a newline at the end of the class definition.
Input without newline at end of class definition:
Output without newline (comment on else is aligned with endif)
Input with newline at end of class definition:
Output with newline (comment on else is not aligned with endif)
I am curious why this is the case and also why it is not aligned with the initial if-PP. Also I would like to know how to set clang-format to not differentiate and either always align or not, regardless of a newline at the end of the definition (in this case).