[all-commits] [llvm/llvm-project] 9b68c0: [clang-format] Allow decltype in requires clause (...

Emilia Kond via All-commits all-commits at lists.llvm.org
Wed Jan 31 22:00:57 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9b68c095d6b52d6ec0390c653528f65c42e5f570
      https://github.com/llvm/llvm-project/commit/9b68c095d6b52d6ec0390c653528f65c42e5f570
  Author: Emilia Kond <emilia at rymiel.space>
  Date:   2024-02-01 (Thu, 01 Feb 2024)

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

  Log Message:
  -----------
  [clang-format] Allow decltype in requires clause (#78847)

If clang-format is not sure whether a `requires` keyword starts a
requires clause or a requires expression, it looks ahead to see if any
token disqualifies it from being a requires clause. Among these tokens
was `decltype`, since it fell through the switch.

This patch allows decltype to exist in a require clause.

I'm not 100% sure this change won't have repercussions, but that just
means we need more test coverage!

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




More information about the All-commits mailing list