mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-21 22:16:41 +00:00
Support C++ friend declarations for Carbon generic classes (#8026)
This commit is contained in:
1 parent
8779d15e18
commit
56d9bbc40a
2 files changed
+33
No files matched your search
@@ -1029,6 +1029,16 @@ static auto BuildClassDefinition(Context& context,
|
||||
|
||||
class_info.friend_scopes.Insert(
|
||||
context.types().GetConstantId(friend_type_id));
|
||||
} else {
|
||||
auto* friend_decl = f->getFriendDecl();
|
||||
// TODO: support function friend decls.
|
||||
if (!friend_decl->isFunctionOrFunctionTemplate()) {
|
||||
auto key = SemIR::ClangDeclKey::ForNonFunctionDecl(friend_decl);
|
||||
auto inst_id =
|
||||
ImportCppDecl(context, SemIR::LocId(import_ir_inst_id), key);
|
||||
|
||||
class_info.friend_scopes.Insert(context.constant_values().Get(inst_id));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user