[PATCH] D137052: [clang-format] Don't skip #else/#elif of #if 0

Owen Pan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 1 12:49:48 PDT 2022


owenpan added a comment.

In D137052#3899091 <https://reviews.llvm.org/D137052#3899091>, @aaron.ballman wrote:

> Can you also add a test for `#elifdef` and `#elifndef`?

I added a test (lines 6130-6136) for `#elif` but not `#elifdef` and `#elifndef` because all three are on the same execution path in the parser (lines 1113-1115). Actually, they all call the same function (via `parsePPElIf()`) that `#else` does. This is probably why none of them has a separate test in the `LayoutStatementsAroundPreprocessorDirectives` unit test. So I will do the opposite and remove the test for `#elif`. :)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137052/new/

https://reviews.llvm.org/D137052



More information about the cfe-commits mailing list