[clang] [clang-tools-extra] [clang] Concepts: support pack expansions for type constraints (PR #132626)
Matheus Izvekov via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 24 05:59:27 PDT 2025
================
@@ -70,7 +70,14 @@ struct alignas(ConstraintAlignment) AtomicConstraint {
// We do not actually substitute the parameter mappings into the
// constraint expressions, therefore the constraint expressions are
// the originals, and comparing them will suffice.
- if (ConstraintExpr != Other.ConstraintExpr)
+ if (AC.ConstraintExpr != Other.AC.ConstraintExpr)
+ return false;
+
+ // FIXME: As the normalization cache doesn't take
+ // ArgumentPackSubstitutionIndex into account,
+ // this won't have an effect.
+ if (AC.ArgumentPackSubstitutionIndex !=
+ Other.AC.ArgumentPackSubstitutionIndex)
----------------
mizvekov wrote:
I think in this case the constraint was expanded, the pack index should be part of the mapping.
A different pack index is notionally a different template parameter, or at least another slot where a different template argument could be located, so the different treatment wrt to non-pack parameters doesn't seem consistent to me.
Though it's possible this doesn't make a difference in practice.
I failed to come up with an example where this would really matter, ie make something ill-formed where it's not, or vice-versa.
https://github.com/llvm/llvm-project/pull/132626
More information about the cfe-commits
mailing list