[all-commits] [llvm/llvm-project] 35f2ac: [clang-format] Fix inconsistent annotation of oper...

David K Turner via All-commits all-commits at lists.llvm.org
Sun Feb 5 13:33:49 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 35f2ac1763adcbd5ee9b49a98de24c0c420c323e
      https://github.com/llvm/llvm-project/commit/35f2ac1763adcbd5ee9b49a98de24c0c420c323e
  Author: David Turner <turner_david_k at cat.com>
  Date:   2023-02-05 (Sun, 05 Feb 2023)

  Changed paths:
    M clang/lib/Format/TokenAnnotator.cpp
    M clang/lib/Format/TokenAnnotator.h
    M clang/unittests/Format/FormatTest.cpp
    M clang/unittests/Format/TokenAnnotatorTest.cpp

  Log Message:
  -----------
  [clang-format] Fix inconsistent annotation of operator&

Token annotator incorrectly annotates 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.

Differential Revision: https://reviews.llvm.org/D141959




More information about the All-commits mailing list