[all-commits] [llvm/llvm-project] 15e14f: [clang-format] Preserve AmpAmpTokenType in nested ...

Emilia Kond via All-commits all-commits at lists.llvm.org
Mon Jun 26 02:29:58 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 15e14f129fe24db989ed91737e96505863e20c60
      https://github.com/llvm/llvm-project/commit/15e14f129fe24db989ed91737e96505863e20c60
  Author: Emilia Kond <emilia at rymiel.space>
  Date:   2023-06-26 (Mon, 26 Jun 2023)

  Changed paths:
    M clang/lib/Format/UnwrappedLineParser.cpp
    M clang/unittests/Format/TokenAnnotatorTest.cpp

  Log Message:
  -----------
  [clang-format] Preserve AmpAmpTokenType in nested parentheses

When parsing a requires clause, the UnwrappedLineParser would delegate to
parseParens with an AmpAmpTokenType set to BinaryOperator. However,
parseParens would not carry this over into any nested parens, meaning it
could assign a different token type to an && in a requires clause.

This patch makes sure parseParens inherits its parameter when performing
a recursive call.

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

Reviewed By: HazardyKnusperkeks, owenpan, MyDeveloperDay

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




More information about the All-commits mailing list