mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 10:51:06 +01:00
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:
@@ -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 "
|
||||
|
||||
Reference in New Issue
Block a user