Reverse Interop: Class declarations (#6955)

Generate class declarations for Carbon classes referenced from C++

Based on #6940, review from eb62070a01
onwards
This commit is contained in:
David Blaikie
2026-03-25 04:50:08 +00:00
committed by GitHub
parent 7345f4e860
commit 415cd6f8f0
3 changed files with 118 additions and 19 deletions
@@ -14,6 +14,8 @@
package Other;
namespace Nested;
namespace Nested.Again;
class Class1;
// --- namespace.carbon
library "[[@TEST_NAME]]";
@@ -23,4 +25,14 @@ import Cpp inline '''
namespace X = Carbon::Other;
namespace Y = Carbon::Other::Nested;
namespace Z = Carbon::Other::Nested::Again;
Carbon::Other::Class1 *glbl;
template<typename T> void f1() {
T* v;
}
void f2() {
f1<Carbon::Other::Class1>();
}
''';