[PATCH] D145656: [clang-format] Treat &/&& as reference when followed by requires clause

Emilia Dreamer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 8 23:17:55 PST 2023


rymiel created this revision.
rymiel added a project: clang-format.
rymiel added reviewers: HazardyKnusperkeks, MyDeveloperDay, owenpan.
Herald added a project: All.
rymiel requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Previously, the token annotator would get confused and annotate a member
function's ref qualifier as a binary operator, if said function also had
a requires clause after it.

This patch accounts for that, treating requires clauses more similarly
to `noexcept`, which also comes after the ref qualifier.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D145656

Files:
  clang/lib/Format/TokenAnnotator.cpp
  clang/unittests/Format/FormatTest.cpp
  clang/unittests/Format/TokenAnnotatorTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145656.503642.patch
Type: text/x-patch
Size: 5083 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230309/b9c4d5be/attachment.bin>


More information about the cfe-commits mailing list