This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Treat NTTP default values as expressions
ClosedPublic

Authored by rymiel on Mar 23 2023, 2:36 PM.

Details

Summary

clang-format already has logic to threat the right-hand side of an
equals sign. This patch applies that logic to template defaults,
which are likely to be non-template type parameters in which case the
default value should be annotated as an expression.
This should mostly only ever apply to bool and &&.

Fixes https://github.com/llvm/llvm-project/issues/61664

Diff Detail

Event Timeline

rymiel created this revision.Mar 23 2023, 2:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 23 2023, 2:36 PM
rymiel requested review of this revision.Mar 23 2023, 2:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 23 2023, 2:36 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
owenpan accepted this revision.Mar 24 2023, 12:18 AM
This revision is now accepted and ready to land.Mar 24 2023, 12:18 AM
MyDeveloperDay accepted this revision.Mar 24 2023, 3:34 AM
This revision was landed with ongoing or failed builds.Mar 25 2023, 6:42 PM
This revision was automatically updated to reflect the committed changes.