[clang-format] Fix WhitespaceSensitiveMacros not being honoured when macro...
[clang-format] Fix WhitespaceSensitiveMacros not being honoured when macro closing parenthesis is followed by a newline. Fixes https://github.com/llvm/llvm-project/issues/54522. This fixes regression introduced in https://github.com/llvm/llvm-project/commit/5e5efd8a91f2e340e79a73bedbc6ab66ad4a4281. Before the culprit commit, macros in WhitespaceSensitiveMacros were correctly formatted even if their closing parenthesis weren't followed by semicolon (or, to be precise, when they were followed by a newline). That commit changed the type of the macro token type from TT_UntouchableMacroFunc to TT_FunctionLikeOrFreestandingMacro. Correct formatting (with `WhitespaceSensitiveMacros = ['FOO']`): ``` FOO(1+2) FOO(1+2); ``` Regressed formatting: ``` FOO(1 + 2) FOO(1+2); ``` Reviewed By: HazardyKnusperkeks, owenpan, ksyx Differential Revision: https://reviews.llvm.org/D123676
Loading
Please sign in to comment