mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 15:31:08 +01:00
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:
+1
-1
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user