[PATCH] D139211: [WIP][clang-format] Properly handle the C11 _Generic keyword.

2022-12-22 Thread Emilia Dreamer via Phabricator via cfe-commits
rymiel planned changes to this revision. rymiel added a comment. Going to try to make the indentation of the cases following the controlling expression not continuations, since that results in weird results such as: #define LIMIT_MAX(T) \ _Generic(

[PATCH] D139211: [WIP][clang-format] Properly handle the C11 _Generic keyword.

2022-12-13 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay accepted this revision. MyDeveloperDay added inline comments. This revision is now accepted and ready to land. Comment at: clang/lib/Format/ContinuationIndenter.cpp:1691 +(CurrentState.IsCSharpGenericTypeConstraint) || GenericSelection || (Style.is

[PATCH] D139211: [WIP][clang-format] Properly handle the C11 _Generic keyword.

2022-12-02 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks added a comment. Looks good to me. And adding a token type is absolutely nothing negative. The more tokens get a type, the better. Comment at: clang/lib/Format/TokenAnnotator.cpp:1630 TemplateArgument, + // C11 _Generic selection + C11Generi

[PATCH] D139211: [WIP][clang-format] Properly handle the C11 _Generic keyword.

2022-12-02 Thread Emilia Dreamer via Phabricator via cfe-commits
rymiel added a comment. I put WIP in the title right now because firstly, I still need to write more tests, but also, since I haven't touched the breaking and indenting part of the code before, I want to make sure what I'm doing is sensible. Basically, after making the colons their own type so

[PATCH] D139211: [WIP][clang-format] Properly handle the C11 _Generic keyword.

2022-12-02 Thread Emilia Dreamer via Phabricator via cfe-commits
rymiel created this revision. rymiel added reviewers: HazardyKnusperkeks, owenpan, MyDeveloperDay. Herald added a project: All. rymiel requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This patch properly recognizes the generic selection expr