With D117142, we would now format
struct A { #define A void f() { a(); } #endif };
into
struct A { #ifdef A void f() { a(); } #endif };
because we were looking for the record lbrace without skipping preprocess lines.
Paths
| Differential D123737
[clang-format] Skip preprocessor lines when finding the record lbrace ClosedPublic Authored by aeubanks on Apr 13 2022, 2:40 PM.
Details Summary With D117142, we would now format struct A { #define A void f() { a(); } #endif }; into struct A { #ifdef A void f() { a(); } #endif }; because we were looking for the record lbrace without skipping preprocess lines.
Diff Detail
Event Timelineaeubanks added reviewers: MyDeveloperDay, curdeius, HazardyKnusperkeks, owenpan.Apr 13 2022, 2:41 PM This revision is now accepted and ready to land.Apr 13 2022, 10:24 PM This revision was landed with ongoing or failed builds.Apr 14 2022, 9:31 AM Closed by commit rGf14ebe91c5dd: [clang-format] Skip preprocessor lines when finding the record lbrace (authored by aeubanks). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 422668 clang/lib/Format/UnwrappedLineFormatter.cpp
clang/unittests/Format/FormatTest.cpp
|