diff --git a/lib/ClangImporter/ClangDerivedConformances.cpp b/lib/ClangImporter/ClangDerivedConformances.cpp index 3678a02d5dc..2b109305be3 100644 --- a/lib/ClangImporter/ClangDerivedConformances.cpp +++ b/lib/ClangImporter/ClangDerivedConformances.cpp @@ -1059,7 +1059,7 @@ void swift::conformToCxxFunctionIfNeeded( auto funcPointerType = clangCtx.getPointerType(clangCtx.getFunctionType( operatorCallDecl->getReturnType(), operatorCallParamTypes, - clang::FunctionProtoType::ExtProtoInfo())); + clang::FunctionProtoType::ExtProtoInfo())).withConst(); // Create a fake variable with a function type that matches the type of // `operator()`.