[all-commits] [llvm/llvm-project] 0ebed8: [clang-format] Set requires expression params as n...

Emilia Dreamer via All-commits all-commits at lists.llvm.org
Thu Dec 22 16:23:58 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0ebed862d82134e7a8e42d8dc7944afe765445ba
      https://github.com/llvm/llvm-project/commit/0ebed862d82134e7a8e42d8dc7944afe765445ba
  Author: Emilia Dreamer <emilia at rymiel.space>
  Date:   2022-12-23 (Fri, 23 Dec 2022)

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

  Log Message:
  -----------
  [clang-format] Set requires expression params as not an expression

Previously, the parens of a requires expression's "parameters" were not
explicitly set, meaning they ended up as whatever the outer scope was.
This is a problem in some cases though, since the process of determining
star/amp checks if the token is inside of an expression context

This patch always makes sure the context between those parens are always
set to not be an expression

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

Reviewed By: HazardyKnusperkeks, owenpan

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




More information about the All-commits mailing list