[clang] [clang]: reflection operator parsing for global namespace and primitive types (PR #164692)
Daniel M. Katz via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 23 07:57:14 PDT 2025
================
@@ -1939,6 +1939,43 @@ TypeTraitExpr *TypeTraitExpr::CreateDeserialized(const ASTContext &C,
return new (Mem) TypeTraitExpr(EmptyShell(), IsStoredAsBool);
}
+CXXReflectExpr::CXXReflectExpr(const ASTContext &C, QualType T, QualType Ty)
+ : Expr(CXXReflectExprClass, T, VK_PRValue, OK_Ordinary) {}
+
+CXXReflectExpr::CXXReflectExpr(const ASTContext &C, QualType T, Decl *Arg,
+ bool IsNamespace)
+ : Expr(CXXReflectExprClass, T, VK_PRValue, OK_Ordinary) {}
----------------
katzdm wrote:
Oh @Sirraide , I forgot to mention - the extra state I added to `APValue` is more than a counter; there's also a `QualType` because we otherwise can't distinguish between e.g., "a reflection of an int value" and "a reflection of a short value" (since an `Int`-kind `APValue` isn't, IIUC, sufficiently strongly typed). Assuming there's no clever way around needing that, that might further motivate the approach I outlined above.
https://github.com/llvm/llvm-project/pull/164692
More information about the cfe-commits
mailing list