Merge pull request #70348 from hborla/cxx-generic-subscript

[cxx-interop] Allow imported subscript to have generic parameters.
This commit is contained in:
Holly Borla
2023-12-10 13:51:25 -08:00
committed by GitHub
6 changed files with 15 additions and 15 deletions

View File

@@ -8831,6 +8831,7 @@ SubscriptDecl *SubscriptDecl::createImported(ASTContext &Context, DeclName Name,
ParameterList *Indices,
SourceLoc ArrowLoc, Type ElementTy,
DeclContext *Parent,
GenericParamList *GenericParams,
ClangNode ClangN) {
assert(ClangN && ElementTy);
auto *DeclPtr = allocateMemoryForDecl<SubscriptDecl>(
@@ -8839,7 +8840,7 @@ SubscriptDecl *SubscriptDecl::createImported(ASTContext &Context, DeclName Name,
auto *const SD = ::new (DeclPtr)
SubscriptDecl(Name, SourceLoc(), StaticSpellingKind::None, SubscriptLoc,
Indices, ArrowLoc, /*ElementTyR=*/nullptr, Parent,
/*GenericParams=*/nullptr);
GenericParams);
SD->setElementInterfaceType(ElementTy);
SD->setClangNode(ClangN);
return SD;