[clang] [clang-tools-extra] [clang-query] Allow for trailing comma in matchers (PR #148018)

2025-07-15 Thread Remy Farley via cfe-commits
one-d-wide wrote: Duh, apparently lit's internal cli interpreter, enabled due to [this](https://github.com/llvm/llvm-project/blob/02d3738be92eac38cebfb7b670673abb9538ca76/compiler-rt/test/lit.common.cfg.py#L123-L125) (setting LIT_USE_INTERNAL_SHELL=1 reproduces the error), doesn't even attempt

[clang] [clang-tools-extra] [clang-query] Allow for trailing comma in matchers (PR #148018)

2025-07-15 Thread Remy Farley via cfe-commits
https://github.com/one-d-wide updated https://github.com/llvm/llvm-project/pull/148018 >From 22e6282b5dbad9c76b036ef379a4c32ae8d9 Mon Sep 17 00:00:00 2001 From: "Remy D. Farley" Date: Tue, 15 Jul 2025 14:51:31 + Subject: [PATCH] [clang-query] Allow for trailing comma in matchers --- c

[clang] [clang-tools-extra] [clang-query] Allow for trailing comma in matchers (PR #148018)

2025-07-15 Thread Remy Farley via cfe-commits
@@ -0,0 +1,10 @@ +// RUN: clang-query -c "match \ +// RUN: functionDecl( \ +// RUN: hasName( \ +// RUN: \"foo\", \ +// RUN: ), \ +// RUN: ) \ +// RUN: " %s -- | FileCheck %s + +// CHECK: trailing-comma.c:10:1: note: "root" binds here one-

[clang] [clang-tools-extra] [clang-query] Allow for trailing comma in matchers (PR #148018)

2025-07-12 Thread Remy Farley via cfe-commits
one-d-wide wrote: I don't think this is much of an issue. Once you attempt to interpret a query with trailing comma in it as C++ code, a compiler (or even an LSP) will usually emit a (mostly) unambiguous error, which should be trivial to correct. And that's it. Existing queries, including ones

[clang] [clang-tools-extra] [clang-query] Allow for trailing comma in matchers (PR #148018)

2025-07-12 Thread Remy Farley via cfe-commits
https://github.com/one-d-wide updated https://github.com/llvm/llvm-project/pull/148018 >From b35f9ebdd2e345449c2cea8df8d6731cde33dcb3 Mon Sep 17 00:00:00 2001 From: "Remy D. Farley" Date: Sat, 12 Jul 2025 11:53:58 + Subject: [PATCH] [clang-query] Allow for trailing comma in matchers --- c

[clang] [clang-tools-extra] [clang-query] Allow for trailing comma in matchers (PR #148018)

2025-07-10 Thread Remy Farley via cfe-commits
https://github.com/one-d-wide created https://github.com/llvm/llvm-project/pull/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-