Export virtual/abstract/override functions as virtual (#7211)

This provides enough to Clang so it can include these new virtual
functions in the vtable of Carbon types derived from C++ types.
This commit is contained in:
David Blaikie
2026-05-18 19:04:33 +00:00
committed by GitHub
parent 832d46f01b
commit 31db4a0931
3 changed files with 49 additions and 18 deletions
+3
View File
@@ -535,6 +535,9 @@ static auto BuildCppToCarbonThunkDecl(
constexpr_kind, clang_loc, trailing_requires_clause);
// TODO: Map Carbon access to C++ access.
thunk_function_decl->setAccess(clang::AS_public);
thunk_function_decl->setVirtualAsWritten(
target.function.virtual_modifier !=
SemIR::Function::VirtualModifier::None);
} else {
thunk_function_decl = clang::FunctionDecl::Create(
ast_context, target.decl_context, clang_loc, name_info,