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:
Richard Smith
2026-04-14 00:18:33 +00:00
committed by GitHub
parent 5b1de7633c
commit 43867a678b
9 changed files with 135 additions and 46 deletions
+11
View File
@@ -44,4 +44,15 @@ auto MapCppAccess(clang::DeclAccessPair access_pair) -> SemIR::AccessKind {
}
}
auto MapToCppAccess(SemIR::AccessKind access) -> clang::AccessSpecifier {
switch (access) {
case SemIR::AccessKind::Public:
return clang::AS_public;
case SemIR::AccessKind::Protected:
return clang::AS_protected;
case SemIR::AccessKind::Private:
return clang::AS_private;
}
}
} // namespace Carbon::Check