[PATCH] D141959: [clang-format] Fix inconsistent identification of operator&

David K Turner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 17 11:53:30 PST 2023


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

Token annotator for clang-format incorrectly identifies operator& as a reference type in situations like Boost serialization archives <https://www.boost.org/doc/libs/1_81_0/libs/serialization/doc/tutorial.html>.

Add annotation rules for standalone and chained operator& instances while preserving behavior for reference declarations at class scope.  Add tests to validate annotation and formatting behavior.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D141959

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: D141959.489899.patch
Type: text/x-patch
Size: 7600 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230117/bb0709f9/attachment-0001.bin>


More information about the cfe-commits mailing list