mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Don't open existentials when calling C++ function templates
C++ function templates require specialization, which does not work with opened existentials. Disable opening for them.
This commit is contained in:
@@ -1354,6 +1354,11 @@ shouldOpenExistentialCallArgument(
|
||||
break;
|
||||
}
|
||||
|
||||
// C++ function templates require specialization, which is not possible with
|
||||
// opened existential archetypes, so do not open.
|
||||
if (isa_and_nonnull<clang::FunctionTemplateDecl>(callee->getClangDecl()))
|
||||
return None;
|
||||
|
||||
ASTContext &ctx = callee->getASTContext();
|
||||
if (!ctx.LangOpts.EnableOpenedExistentialTypes)
|
||||
return None;
|
||||
|
||||
Reference in New Issue
Block a user