mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
Reverse interop support for type aliases. (#7043)
Allow any type that has a mapping from Carbon to C++ to be exposed to C++ via name lookup. This also exposes the logic to export Carbon classes to C++ to apply during type mapping, which gives very slight support for passing Carbon types to C++ functions from Carbon, but not really enough to sensibly test yet. Depends on #7042.
This commit is contained in:
@@ -131,12 +131,8 @@ auto ExportClassToCpp(Context& context, SemIR::LocId loc_id,
|
||||
}
|
||||
|
||||
auto* identifier_info = GetClangIdentifierInfo(context, class_info.name_id);
|
||||
if (!identifier_info) {
|
||||
// TODO: Handle keyword package names like `Cpp` and `Core`. These can
|
||||
// be named from C++ via an alias.
|
||||
context.TODO(loc_id, "interop with non-identifier package name");
|
||||
return nullptr;
|
||||
}
|
||||
CARBON_CHECK(identifier_info, "non-identifier class name {0}",
|
||||
class_info.name_id);
|
||||
|
||||
auto* decl_context =
|
||||
ExportNameScopeToCpp(context, loc_id, class_info.parent_scope_id);
|
||||
|
||||
Reference in New Issue
Block a user