[clang] [Clang] [P2996] Support reflecting arbitrary types and aliases (PR #232074)
Ambrose Leeb via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 16 12:47:48 PDT 2026
================
@@ -315,6 +318,28 @@ ExprDependence clang::computeDependence(CXXUuidofExpr *E) {
return turnTypeToValueDependence(E->getExprOperand()->getDependence());
}
+ExprDependence clang::computeDependence(CXXReflectExpr *E) {
+ QualType QT = E->getTypeSourceInfo()->getType();
+ ExprDependence D =
+ turnTypeToValueDependence(toExprDependenceAsWritten(QT->getDependence()));
+ if (isTypeAliasAsReflectionName(QT)) {
+ const NamedDecl *Alias;
+ if (const auto *T = dyn_cast<TypedefType>(QT.getTypePtr())) {
+ Alias = T->getDecl();
+ } else {
+ const auto *TST = cast<TemplateSpecializationType>(QT.getTypePtr());
+ Alias = TST->getTemplateName().getAsTemplateDecl();
+ for (const auto &Arg : TST->template_arguments())
+ if (Arg.isDependent())
+ D |= ExprDependence::ValueInstantiation;
----------------
Sirraide wrote:
I believe packs are expanded in tree transform before we get here
https://github.com/llvm/llvm-project/pull/232074
More information about the cfe-commits
mailing list