[all-commits] [llvm/llvm-project] 834ac2: [clang-format] Allow ternary in all templates (#96...

Emilia Kond via All-commits all-commits at lists.llvm.org
Sat Jun 29 04:39:56 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 834ac2e205dd8e492d6084a7952e68e19a1f54db
      https://github.com/llvm/llvm-project/commit/834ac2e205dd8e492d6084a7952e68e19a1f54db
  Author: Emilia Kond <emilia at rymiel.space>
  Date:   2024-06-29 (Sat, 29 Jun 2024)

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

  Log Message:
  -----------
  [clang-format] Allow ternary in all templates (#96801)

Currently, question mark and colon tokens are not allowed between angle
brackets, as a template argument, if we are in an expression context.

However, expressions can still allowed in non-expression contexts,
leading to inconsistent formatting.

Removing this check entirely fixes this issue, and, surprisingly, breaks
no tests.

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



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list