This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Correctly recognize binary operators in template arguments with parenthesized literals.
ClosedPublic

Authored by curdeius on Mar 16 2022, 1:57 PM.

Details

Summary

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

Before, code like foo<b & 1> was formatted correctly but foo<b & (1)> wasn't.
This patch fixes this inconsistency.

Diff Detail

Event Timeline

curdeius created this revision.Mar 16 2022, 1:57 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 16 2022, 1:57 PM
curdeius requested review of this revision.Mar 16 2022, 1:57 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 16 2022, 1:57 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
This revision is now accepted and ready to land.Mar 16 2022, 2:06 PM
owenpan accepted this revision.Mar 16 2022, 8:56 PM
owenpan added inline comments.
clang/lib/Format/TokenAnnotator.cpp
2186

Remove braces. :)

This revision was landed with ongoing or failed builds.Mar 17 2022, 1:37 AM
This revision was automatically updated to reflect the committed changes.
curdeius marked an inline comment as done.