[all-commits] [llvm/llvm-project] ead964: [clang-format] Annotate noexcept, explicit specifi...

Emilia Dreamer via All-commits all-commits at lists.llvm.org
Wed Mar 22 11:25:34 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ead9644684e85e0611f3b0ff72926820f1277e09
  Author: Emilia Dreamer <emilia at rymiel.space>
  Date:   2023-03-22 (Wed, 22 Mar 2023)

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

  Log Message:
  [clang-format] Annotate noexcept, explicit specifiers as containing expressions

The noexcept specifier and explicit specifier can optionally include a
boolean expression to make these specifiers apply conditionally,
however, clang-format didn't set the context for the parenthesized
content of these specifiers, meaning they inherited the parent context,
which usually isn't an expressions, leading to misannotated binary

This patch applies expression context to the content of these
specifiers, making them similar to the static_assert keyword.

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

Reviewed By: owenpan, MyDeveloperDay

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

More information about the All-commits mailing list