[cxx-interop] Honor default expressions for unnamed arguments

We stumbled upon an old workaround that disabled the synthesis of Swift default expressions for C++ function parameters that don't have a name.

This change removes the workaround.

rdar://162310543
This commit is contained in:
Egor Zhdan
2025-10-10 16:06:55 +01:00
parent 3ce1d11c58
commit f157e71ff5
5 changed files with 15 additions and 4 deletions

View File

@@ -2549,10 +2549,6 @@ SwiftDeclSynthesizer::makeDefaultArgument(const clang::ParmVarDecl *param,
const swift::Type &swiftParamTy,
SourceLoc paramLoc) {
assert(param->hasDefaultArg() && "must have a C++ default argument");
if (!param->getIdentifier())
// Work around an assertion failure in CXXNameMangler::mangleUnqualifiedName
// when mangling std::__fs::filesystem::path::format.
return nullptr;
ASTContext &ctx = ImporterImpl.SwiftContext;
clang::ASTContext &clangCtx = param->getASTContext();