Allow interop with templated but non-template functions. (#5809)

For example, this would allow using `std::string::size`, which is
templated because it's a member of the class template
`std::basic_string`, but isn't itself a function template.
This commit is contained in:
Richard Smith
2025-07-17 15:04:19 +00:00
committed by GitHub
parent dd76c9bd13
commit 9f67fa4b0f
3 changed files with 169 additions and 1 deletions
+2 -1
View File
@@ -1073,7 +1073,8 @@ static auto ImportFunctionDecl(Context& context, SemIR::LocId loc_id,
MarkFailedDecl(context, clang_decl);
return SemIR::ErrorInst::InstId;
}
if (clang_decl->getTemplatedKind() != clang::FunctionDecl::TK_NonTemplate) {
if (clang_decl->getTemplatedKind() ==
clang::FunctionDecl::TK_FunctionTemplate) {
context.TODO(loc_id, "Unsupported: Template function");
MarkFailedDecl(context, clang_decl);
return SemIR::ErrorInst::InstId;