[all-commits] [llvm/llvm-project] 50acd6: [clang-format] Don't format typename template para...

Emilia Dreamer via All-commits all-commits at lists.llvm.org
Sat Apr 1 06:48:12 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 50acd67018a53239f11a2889c28f77a1c7dc8c6b
  Author: Emilia Dreamer <emilia at rymiel.space>
  Date:   2023-04-01 (Sat, 01 Apr 2023)

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

  Log Message:
  [clang-format] Don't format typename template parameters as expression

bb4f6c4dca98a47054117708015bb2724256ee83 made it so that template
parameter defaults are seen akin to assignments and formatted as
expressions, however, the patch did this for all template parameters,
even for `typename` template parameters.

This patch formats `typename` and `class` template parameters as types.

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

Reviewed By: HazardyKnusperkeks, owenpan, MyDeveloperDay

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

More information about the All-commits mailing list