Skip to content

Conversation

@egorzhdan
Copy link
Contributor

When a default constructor is declared, but does not have a body because it is defaulted (= default;), Swift did not emit the IR for it. This was causing linker error for types such as std::map in libstdc++ when someone tried to initialize such types from Swift.

rdar://110638499 / resolves #61412

@egorzhdan egorzhdan added the c++ interop Feature: Interoperability with C++ label Jun 12, 2023
@egorzhdan egorzhdan requested review from hyp and zoecarver as code owners June 12, 2023 15:25
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan
Copy link
Contributor Author

@swift-ci please test Windows

@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test macOS

@egorzhdan
Copy link
Contributor Author

@swift-ci please test Windows

When a default constructor is declared, but does not have a body because it is defaulted (`= default;`), Swift did not emit the IR for it. This was causing linker error for types such as `std::map` in libstdc++ when someone tried to initialize such types from Swift.

rdar://110638499 / resolves #61412
@egorzhdan egorzhdan force-pushed the egorzhdan/irgen-defaulted-constructor branch from 7ca1163 to b459fb5 Compare June 12, 2023 19:07
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan egorzhdan merged commit 9220ec1 into main Jun 13, 2023
@egorzhdan egorzhdan deleted the egorzhdan/irgen-defaulted-constructor branch June 13, 2023 00:05
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.

Linker error when using std::map default constructor from Swift on Linux

3 participants