Break an unwrapped line before the first parameter declaration in a K&R C function definition.
See PR51074.
Paths
| Differential D106112
[clang-format] Break an unwrapped line at a K&R C parameter decl ClosedPublic Authored by owenpan on Jul 15 2021, 5:04 PM.
Details Summary Break an unwrapped line before the first parameter declaration in a K&R C function definition. See PR51074.
Diff Detail
Event TimelineThis revision is now accepted and ready to land.Jul 16 2021, 4:13 AM Comment Actions Looks okay, but I was wondering if we don't want to guard all K&R-related changes behind e.g. `Standard: Cpp78``, so as not to possibly introduce strange bugs in newer modes. Comment Actions
I wouldn't be opposed to that idea Comment Actions
I think this would be reasonable. Comment Actions
I just reviewed the differences between K&R C (circa 1978) and ANSI/ISO C again and didn't see anything else that would impact clang-format, so a new Standard enum value for C78 is not needed. Nevertheless, we can add a boolean option e.g. C78ParameterDecl in the future if this patch causes regressions for some users. WDYT? Comment Actions
Sounds reasonable. This revision was landed with ongoing or failed builds.Jul 19 2021, 1:34 PM Closed by commit rG9da70ab3d43c: [clang-format] Break an unwrapped line at a K&R C parameter decl (authored by owenpan). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 359895 clang/lib/Format/UnwrappedLineParser.h
clang/lib/Format/UnwrappedLineParser.cpp
clang/unittests/Format/FormatTest.cpp
|