[clang-format] Don't finalize #if, #else, #endif, etc.
authorOwen Pan <owenpiano@gmail.com>
Mon, 19 Jun 2023 06:18:00 +0000 (23:18 -0700)
committerOwen Pan <owenpiano@gmail.com>
Wed, 21 Jun 2023 22:15:57 +0000 (15:15 -0700)
commit8e85739a5f24e34cb22768fe6ef33b593ed054df
treeae175b124461531f479ee1c018d2f11dd5291e22
parenta27c416b89249c1c4c5f47db45d1be690eb928df
[clang-format] Don't finalize #if, #else, #endif, etc.

Don't finalize a preprocessor branch directive if it's the first
token of an annotated line. See the rationale at
https://reviews.llvm.org/D150057#inline-1449546.

Fixes #63379

Differential Revision: https://reviews.llvm.org/D153243
clang/lib/Format/UnwrappedLineFormatter.cpp
clang/lib/Format/WhitespaceManager.cpp
clang/unittests/Format/FormatTest.cpp