[clang] [clang-tools-extra] [clang] support pack expansions for trailing requires clauses (PR #133190)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 2 06:34:52 PDT 2025
================
@@ -78,6 +78,22 @@ class UnresolvedSetImpl;
class VarTemplateDecl;
enum class ImplicitParamKind;
+// Holds a constraint expression along with a pack expansion index, if
+// expanded.
+struct AssociatedConstraint {
+ const Expr *ConstraintExpr = nullptr;
+ int ArgumentPackSubstitutionIndex = -1;
----------------
erichkeane wrote:
I was thinking about it... I'd LOVE instead (though this is a 'more work' thing :D so nothing to do here unless you'd like to ) if we just had a `std::optional` like type to represent all of these substitution/pack indexes. The difference here is that the `optional` type would just use a single value as its `unset` state instead of a separate value, so we don't pay the size cost.
Additionally, we could make all of these unsigned instead of signed ints, so presumably we get a little bit of (unusable for other reasons!) range back.
Also/also: serialization/etc all ends up being self-solved since they can have their own serialization/etc.
https://github.com/llvm/llvm-project/pull/133190
More information about the cfe-commits
mailing list