[clang] [clang-format] Add first support for reflection (PR #193794)
Björn Schäpers via cfe-commits
cfe-commits at lists.llvm.org
Sat Apr 25 12:25:28 PDT 2026
HazardyKnusperkeks wrote:
> Can we wait until the proposals have landed and clang/gcc have implemented them? My guess (and hope) is that the clang lexer will give us new tokens for `[:`, `:]`, and `^^`.
As far as I can see the [standard is done](https://herbsutter.com/2026/03/29/c26-is-done-trip-report-march-2026-iso-c-standards-meeting-london-croydon-uk/?utm_source=chatgpt.com), GCC 16 (who's release is imminent) implements all of it (although it still needs to be opted in) and we have an active bug report.
The lexer already gives the `tok::caretcaret` when the option `Reflection` is enabled, so work in clang at least started.
If we get the splicers from the lexer, that would be great, but this works and as soon as they implement it in the lexer the token annotator test fails and I sure hope they either know how to fix that them self or come and ask us.
It would be a shame if a modern code base will (partially) disable clang-format, just because we detect the code wrongfully as objective c once they start using reflection.
https://github.com/llvm/llvm-project/pull/193794
More information about the cfe-commits
mailing list