[all-commits] [llvm/llvm-project] 041a8a: [clang-query] Allow for trailing comma in matchers...

Remy Farley via All-commits all-commits at lists.llvm.org
Tue Jul 15 11:09:46 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 041a8a9e5a00358491fb98e4f6156f0882bf5bea
      https://github.com/llvm/llvm-project/commit/041a8a9e5a00358491fb98e4f6156f0882bf5bea
  Author: Remy Farley <one-d-wide at protonmail.com>
  Date:   2025-07-15 (Tue, 15 Jul 2025)

  Changed paths:
    M clang-tools-extra/docs/ReleaseNotes.rst
    A clang-tools-extra/test/clang-query/trailing-comma.c
    M clang/lib/ASTMatchers/Dynamic/Parser.cpp

  Log Message:
  -----------
  [clang-query] Allow for trailing comma in matchers (#148018)

Allow AST matches in clang-query to have a trailing comma at the end of
matcher arguments. Makes it nicer to work with queries that span
multiple lines.

So, for example, the following is possible:

```clang-query
match namedDecl(
  isExpansionInMainFile(),
  anyOf(
    varDecl().bind("var"),
    functionDecl().bind("func"),
    # enumDecl().bind("enum"),
  ),
)
```



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