[clang] [clang]: reflection operator parsing for global namespace and primitive types (PR #164692)

Hubert Tong via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 23 12:07:14 PDT 2025


================
@@ -4348,6 +4348,9 @@ bool Lexer::LexTokenInternal(Token &Result, bool TokAtPhysicalStartOfLine) {
     if (Char == '=') {
       CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
       Kind = tok::caretequal;
+    } else if (LangOpts.Reflection && Char == '^') {
----------------
hubert-reinterpretcast wrote:

Simple preprocessor compliance test:
```
#define WHAT ^^ ## =
#define IGNORE(X) /*nothing*/
#define EXPAND_AND_DROP(X) IGNORE(X)
EXPAND_AND_DROP(WHAT)
```
Accept pre-C++26. Error in C++26.

https://github.com/llvm/llvm-project/pull/164692


More information about the cfe-commits mailing list