Skip to content

[cxx-interop] Instantiate the std::function constructor with a const pointer argument #74619

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 21, 2024

Conversation

egorzhdan
Copy link
Contributor

We were trying to instantiate a constructor for std::function from a C function pointer with a non-const function pointer type. That worked well on most platforms, where std::function defines a single constructor for const and non-const function pointers, but failed on UBI 9.

This fixes a test (Interop/Cxx/stdlib/use-std-function.swift) on UBI Linux.

rdar://118026392

…t pointer argument

We were trying to instantiate a constructor for `std::function` from a C function pointer with a non-const function pointer type. That worked well on most platforms, where `std::function` defines a single constructor for const and non-const function pointers, but failed on UBI 9.

This fixes a test (`Interop/Cxx/stdlib/use-std-function.swift`) on UBI Linux.

rdar://118026392
@egorzhdan egorzhdan added the c++ interop Feature: Interoperability with C++ label Jun 21, 2024
@egorzhdan
Copy link
Contributor Author

@swift-ci please test UBI9

@egorzhdan
Copy link
Contributor Author

@swift-ci Please Build Toolchain UBI9

@egorzhdan egorzhdan requested a review from Xazax-hun June 21, 2024 13:25
Copy link
Contributor

@Xazax-hun Xazax-hun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan
Copy link
Contributor Author

The build failure on UBI9 is unrelated to this patch.

@egorzhdan egorzhdan merged commit d07e8ce into main Jun 21, 2024
3 of 4 checks passed
@egorzhdan egorzhdan deleted the egorzhdan/std-function-inout branch June 21, 2024 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ interop Feature: Interoperability with C++
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants