Commit Graph

11 Commits

Author SHA1 Message Date
Egor Zhdan
1be7230876 [cxx-interop] Use C++17 standard by default
Clang is using C++17 standard version by default since Clang 16.

Swift’s ClangImporter should do the same, to make sure that clients who run clang and then swiftc without explicit std version see consistent behavior.

rdar://125777068
2024-04-02 16:23:32 +01:00
Egor Zhdan
19a257b36b [cxx-interop] Test stdlib support with newer C++ standards 2024-03-21 16:44:38 +00:00
Egor Zhdan
78b9de1391 [cxx-interop] Run tests with swift-6 compat mode 2024-02-23 16:24:14 +00:00
Egor Zhdan
7218a831a2 [cxx-interop] Test stdlib with the upcoming compat version 2023-11-22 20:12:08 +00:00
Saleem Abdulrasool
1040116e32 IRGen: rework linking against CxxStdlib
Rewrite the handling for the `CxxStdlib` implicit linking to use a
slightly more functional style for filtering.  Additionally, add Windows
to the list providing the overlay.  The Windows linking scenario is a
slightly more complicated as the library names differ between static and
dynamic variants to disambiguate between import libraries and static
libraries.  Take this into account when embedding the library name so
that the linker can find the appropriate content.
2023-08-08 09:03:37 -07:00
Egor Zhdan
6902041e34 [cxx-interop] Force creating a memberwise init for std::pair
In libc++, `pair()` and `pair(_T1 const& __t1, _T2 const& __t2)` are templated with `enable_if`, so these initializers are not imported into Swift.

There should be a way to call `std.pair.init` from Swift, so this change makes sure Swift synthesizes a memberwise initializer for `std.pair`.

rdar://113135110
2023-08-01 18:59:41 +01:00
Alex Lorenz
cf943661ca [cxx-interop] test, enable more tests on windows
These tests require the C++ standard library
2023-07-28 16:02:43 -07:00
Egor Zhdan
4ca1eeb141 [cxx-interop] Make CxxPair's fields mutable
This will be needed to support mutable C++ iterators, e.g. `std::map::iterator`.
2023-07-19 16:05:28 +01:00
Egor Zhdan
8f58eafbd3 [cxx-interop] Make sure interop does not trigger TBD validation errors
This disables TBD validation when C++ interop is enabled, unless an explicit `-validate-tbd-against-ir=` flag was passed.

rdar://83405989 / https://github.com/apple/swift/issues/56458
2023-04-05 16:06:09 +01:00
Alex Lorenz
861d99fa25 [interop] expand std.pair tests after non-trivial record fix 2023-03-17 17:02:14 -07:00
Alex Lorenz
827af150ab [interop] ensure std::pair is imported into Swift 2023-03-14 07:29:48 -07:00