[clang] [clang-tools-extra] [clang-query] Allow for trailing comma in matchers (PR #148018)
Remy Farley via cfe-commits
cfe-commits at lists.llvm.org
Sat Jul 12 05:05:04 PDT 2025
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 ported back from C++, are unaffected.
I see this feature as only helpful during the development of a query, smoothing the experience by, for example, allowing to conveniently comment query arguments out (which also done in a way incompatible with C++ btw).
In which case getting an error is rather annoying, since matcher arguments act more like parameters in a C++ initializer list (where trailing comma is actually allowed), rather than positional arguments in a function.
Updated release notes.
https://github.com/llvm/llvm-project/pull/148018
More information about the cfe-commits
mailing list