Add interop support for naming and "calling" C++ templates. (#6474)

Expose C++ class templates, variable templates, alias templates, and
concepts as callable values in Carbon, and map calls to them into
template-id formation, mirroring how Carbon generics behave. For now,
only type template parameters are supported; non-type and template
template parameters produce a TODO error.
This commit is contained in:
Richard Smith
2025-12-15 17:45:01 +00:00
committed by GitHub
parent a8eca2ece6
commit 6b28213b36
36 changed files with 1411 additions and 126 deletions
+5
View File
@@ -327,6 +327,11 @@ class Stringifier {
step_stack_->PushInstId(inst.inner_id);
}
auto StringifyInst(InstId /*inst_id*/, CppTemplateNameType inst) -> void {
*out_ << "<type of ";
step_stack_->Push(inst.name_id, ">");
}
auto StringifyInst(InstId /*inst_id*/, CustomLayoutType inst) -> void {
auto layout = sem_ir_->custom_layouts().Get(inst.layout_id);
*out_ << "<size " << layout[CustomLayoutId::SizeIndex] << ", align "