Export class friends to C++ (#8068)

This commit is contained in:
Nicholas Bishop authored and GitHub committed 2026-11-03 18:28:21 +00:00
1 parent 5af3b7c47a
commit 66f03aecb1
2 files changed
+48

No files matched your search

@@ -106,3 +106,30 @@ void F() {
b.F();
}
''';
// --- access_exported_private_member_of_friend.carbon
library "[[@TEST_NAME]]";
import Cpp;
inline Cpp '''
class C;
''';
alias C = Cpp.C;
class A {}
class B {
friend C;
fn Make() -> Self { return {}; }
private fn F() {}
}
inline Cpp '''
class C {
void G() {
auto b = Carbon::B::Make();
b.F();
}
};
''';