diff --git a/toolchain/parse/node_ids.h b/toolchain/parse/node_ids.h index 1347a20ea86f..58a437757cbb 100644 --- a/toolchain/parse/node_ids.h +++ b/toolchain/parse/node_ids.h @@ -113,9 +113,20 @@ using AnyRequirementId = NodeIdInCategory; using AnyNonExprNameId = NodeIdInCategory; using AnyPackageNameId = NodeIdInCategory; +namespace Internal { +template +concept IsNodeKind = std::same_as, NodeKind> || + std::same_as, NodeKind::Definition>; + +template +concept IsTypedNode = requires { + { T::Kind } -> IsNodeKind; +}; +} // namespace Internal + // NodeId with kind that matches one of the `T::Kind`s. template - requires(sizeof...(T) >= 2) + requires(sizeof...(T) >= 2 && (Internal::IsTypedNode && ...)) struct NodeIdOneOf : public NodeId { private: // True if `OtherT` is one of `T`.