Support exporting class specifics to C++ (#7634)

This is similar to the previously-added support for accessing generic
carbon classes from C++, but with the specific defined by Carbon, rather
than being derived from template args supplied by clang in
`LoadExternalSpecializations`.

Example:
```carbon
class C(T: type) {
  var t: T;
}
alias A = C(i32);

inline Cpp '''
void F() {
  Carbon::A a;
  a.t = 123;
}
'''
```
This commit is contained in:
Nicholas Bishop
2026-08-13 23:30:24 +00:00
committed by GitHub
parent 54b7f1345a
commit 3bb245364f
5 changed files with 125 additions and 54 deletions
@@ -78,7 +78,7 @@ fn F(x: i512) {
// CHECK:STDERR: Cpp.foo(x);
// CHECK:STDERR: ^
// CHECK:STDERR:
// CHECK:STDERR: min_prelude/parts/int.carbon:10:1: error: semantics TODO: `interop with specific class` [SemanticsTodo]
// CHECK:STDERR: min_prelude/parts/int.carbon:10:1: error: semantics TODO: `interop with non-identifier package name` [SemanticsTodo]
// CHECK:STDERR: class Int(N: IntLiteral) {
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: