HazardyKnusperkeks added a comment. In D109951#3007425 <https://reviews.llvm.org/D109951#3007425>, @guitard0g wrote:
> When looking at test case suggestions, I happened upon another problem that > occurs when handling preprocessor directives. The following code is properly > formatted (following llvm style, with ColumnLimit=0): > > SomeClass::SomeClass() > : a{a}, > b{b} {} > > However this code: > > Foo::Foo() > : x{x}, > #if DEBUG > y{y}, > #endif > z{z} {} > > Is transformed by clang-format (under the same style guidelines) into this: > > Foo::Foo() > : x{x}, > #if DEBUG > y{y}, > #endif > z{z} { > } > > It seems there is some wonkiness with how it handles preprocessor statements > here. I can address this in a another patch. `ColumnLimit` of 0 seems to work very differently in many occasions. ================ Comment at: clang/unittests/Format/FormatTest.cpp:19308 + "#if WINDOWS\n" + "#if DEBUG\n" + " , b{0}\n" ---------------- And now I'm curious, if there is a line between the nested PPs? ``` SomeClass::Constructot() : a{} #if X , b{} #if Y ... ``` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109951/new/ https://reviews.llvm.org/D109951 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits