[all-commits] [llvm/llvm-project] f54d42: [clang-format] Don't put `noexcept` on empty line ...

Emilia Dreamer via All-commits all-commits at lists.llvm.org
Mon Sep 5 03:36:18 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f54d42abcf82e122ed0ac4688f01c1f4da5599f2
      https://github.com/llvm/llvm-project/commit/f54d42abcf82e122ed0ac4688f01c1f4da5599f2
  Author: Emilia Dreamer <emilia at rymiel.space>
  Date:   2022-09-05 (Mon, 05 Sep 2022)

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

  Log Message:
  -----------
  [clang-format] Don't put `noexcept` on empty line following constructor

With the AlwaysBreakTemplateDeclarations option, having a constructor
template for a type consisting of all-uppercase letters with a
noexcept specifier would put said noexcept specifier on its own blank
line.

This is because the all-uppercase type is understood as a macro-like
attribute (such as DEPRECATED()), and noexcept is seen as the
declaration. However, noexcept is a keyword and cannot be an
identifier on its own.

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

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


  Commit: c6e7752f8e144ad78aee2e56a7c901c56be360de
      https://github.com/llvm/llvm-project/commit/c6e7752f8e144ad78aee2e56a7c901c56be360de
  Author: Emilia Dreamer <emilia at rymiel.space>
  Date:   2022-09-05 (Mon, 05 Sep 2022)

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

  Log Message:
  -----------
  [clang-format] Allow `throw` to be a keyword in front of casts

This makes throw more similar to return. However, unlike return,
it has to more strict as to not remove spaces after usages of throw as
a (deprecated) exception specifier.

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

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


  Commit: bd3dd10a8b489ce50823b4cc0049f16610adeee2
      https://github.com/llvm/llvm-project/commit/bd3dd10a8b489ce50823b4cc0049f16610adeee2
  Author: Emilia Dreamer <emilia at rymiel.space>
  Date:   2022-09-05 (Mon, 05 Sep 2022)

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

  Log Message:
  -----------
  [clang-format] Concepts: allow identifiers after negation

Previously, the formatter would refuse to treat identifiers within a
compound concept definition as actually part of the definition, if
they were after the negation operator !. It is now made consistent
with the likes of && and ||.

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

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


Compare: https://github.com/llvm/llvm-project/compare/84c4efbc6d61...bd3dd10a8b48


More information about the All-commits mailing list