Commit Graph

1876 Commits

Author SHA1 Message Date
zoecarver
e1d70f06e7 Revert "[cxx-interop] Import custom NS_OPTIONS correctly"
This reverts commit 46f86f0870.
2023-09-11 11:46:43 -07:00
Alex Lorenz
786c78a895 [interop] do not synthesize special members for C++ records with incomplete fields
The incomplete fields will trigger different assertions when clang is sythensizing constructors/destructors

rdar://109417079
2023-09-11 11:01:51 -07:00
Evan Wilde
3aea04c440 Disabling failing Cxx Interop tests for rebranch
Disabling the following tests to get more visibility on rebranch
 -  Interop/Cxx/stdlib/overlay/std-string-overlay.swift
 -  Interop/Cxx/stdlib/use-std-map.swift
 -  Interop/Cxx/stdlib/use-std-pair.swift
 -  Interop/Cxx/stdlib/use-std-vector.swift

Radar to re-enable tests: rdar://115062687
2023-09-06 13:34:43 -07:00
swift-ci
0a6b51526d Merge remote-tracking branch 'origin/main' into rebranch 2023-09-02 08:54:11 -07:00
Saleem Abdulrasool
8f0129b777 test: disable test pending #68068 2023-09-01 10:58:43 -07:00
Sophia Poirier
86d368f364 Merge remote-tracking branch 'upstream/main' into fix-rebranch-automerger 2023-08-31 14:10:52 -07:00
Doug Gregor
235764beb3 Merge pull request #68213 from DougGregor/custom-ref-count-ops-compiled-pch 2023-08-31 12:49:09 -07:00
swift-ci
88ee4d5355 Merge remote-tracking branch 'origin/main' into rebranch 2023-08-31 09:24:20 -07:00
Egor Zhdan
d4d0478a9b Merge pull request #68217 from apple/egorzhdan/nsnotification
[cxx-interop] Look up `NSNotificationName` in C++ language mode properly
2023-08-31 17:12:47 +01:00
Egor Zhdan
e956e8ac1d [cxx-interop] Look up NSNotificationName in C++ language mode properly
This change makes sure that `NSNotification.Name.NEVPNStatusDidChange` is imported correctly when C++ interop is enabled.

`importer::findSwiftNewtype` is called while writing Clang modules, at a point when the translation-unit scope does not exist (`clangSema.TUScope` is `nullptr`).

That prevents the Clang lookup from discovering `NSNotificationName` declaration.

Instead of trying to pass a translation-unit scope to Clang, let's use qualified name lookup which does not require a scope.

rdar://112199372
2023-08-30 19:37:44 +01:00
Egor Zhdan
38820c19e8 [cxx-interop] NFC: Fix typo in test module name 2023-08-30 19:33:45 +01:00
Doug Gregor
8b0b1bfb72 [Clang importer] Fix lookup of custom ref-counting ops in bridging headers
Lookup for custom reference counting operators into a precompiled bridging
header was causing a crash because there is no "underlying module" in which
to perform the lookup. Handle the lookup at the level of the main Swift
module for such cases, filtering out declarations not coming from Clang.

Fixes rdar://114495840.
2023-08-30 09:53:46 -07:00
swift-ci
79c5934478 Merge remote-tracking branch 'origin/main' into rebranch 2023-08-25 16:33:51 -07:00
Saleem Abdulrasool
88e62d7de2 Merge pull request #68134 from compnerd/fragility
Cxx: mark as fragile
2023-08-25 16:21:35 -07:00
Saleem Abdulrasool
dff40e9399 Cxx: mark as fragile
This library is still fragile as C++ Interop is in preview. Mark it as
fragile to match cxxStdlib.
2023-08-25 11:31:36 -07:00
swift-ci
c66fc7a8e7 Merge remote-tracking branch 'origin/main' into rebranch 2023-08-25 10:53:29 -07:00
Egor Zhdan
5914e7a3d6 Merge pull request #68140 from apple/egorzhdan/inherited-pointee-test
[cxx-interop] Add tests for `.pointee` property access on derived type
2023-08-25 18:49:44 +01:00
swift-ci
dc0e9a610d Merge remote-tracking branch 'origin/main' into rebranch 2023-08-24 10:34:57 -07:00
Egor Zhdan
3f223b54d9 [cxx-interop] Add tests for .pointee property access on derived type 2023-08-23 19:17:35 +01:00
Egor Zhdan
c2f6cc6e05 [cxx-interop] Update an inheritance test
`__swift_interopStaticCast` is now defined in the CxxShim module. Clients do not need to redefine it manually.
2023-08-23 18:45:52 +01:00
swift-ci
3b47e15525 Merge remote-tracking branch 'origin/main' into rebranch 2023-08-22 12:55:59 -07:00
Egor Zhdan
d85b2866ee Merge pull request #68044 from apple/egorzhdan/std-optional-init-nil
[cxx-interop] Conform `std::optional` to `ExpressibleByNilLiteral`
2023-08-22 20:43:29 +01:00
swift-ci
ab2facf872 Merge remote-tracking branch 'origin/main' into rebranch 2023-08-22 11:57:16 -07:00
Egor Zhdan
69727bb3de [cxx-interop] Add test for INADDR_ANY usage
At some point several months ago the `INADDR_ANY` macro from `Darwin.POSIX` module was not imported into Swift correctly. The issue seems to be resolved now. This change adds a test to make sure we don't regress again.

rdar://107429566
2023-08-22 16:51:02 +01:00
Egor Zhdan
c167f4045b [cxx-interop] Conform std::optional to ExpressibleByNilLiteral
This will allow passing `nil` as a parameter to a C++ function that takes a `std::optional<T>`.

rdar://114194600
2023-08-21 19:21:40 +01:00
swift-ci
ba5dbf8cd0 Merge remote-tracking branch 'origin/main' into rebranch 2023-08-21 09:53:51 -07:00
Egor Zhdan
f20617be0c [cxx-interop] Use up-to-date definition of CF_OPTIONS in tests 2023-08-18 16:23:41 +01:00
Egor Zhdan
46f86f0870 [cxx-interop] Import custom NS_OPTIONS correctly
This changes the heuristic that we use to detect `CF_OPTIONS`/`NS_OPTIONS` instantiations in C++ language mode.

Since libraries sometimes declare custom option types that break the assumptions about the names of such types, this lifts the requirements on the type name.

rdar://113524090
rdar://113279214
2023-08-18 15:41:50 +01:00
swift-ci
735f7f424b Merge remote-tracking branch 'origin/main' into rebranch 2023-08-17 08:53:59 -07:00
Saleem Abdulrasool
39a47a0733 Merge pull request #65968 from finagolfin/droid
[android][test] Fix a handful of tests and disable one CxxToSwiftToCxx bridging test
2023-08-17 08:47:29 -07:00
swift-ci
0a607cead8 Merge remote-tracking branch 'origin/main' into rebranch 2023-08-14 13:16:19 -07:00
Egor Zhdan
41e4a50126 Merge pull request #67873 from apple/egorzhdan/pthread_mutexattr_t
[cxx-interop] Make sure to create empty initializers for C++ structs
2023-08-14 21:09:14 +01:00
Egor Zhdan
4eb9c3be37 [cxx-interop] Make sure to create empty initializers for C++ structs
The existing synthesis mechanism had a bug: `cxxRecordDecl->hasDefaultConstructor()` returns true for C++ types with an implicit default constructor, for instance, `pthread_mutexattr_t`.

rdar://113708880
2023-08-14 17:46:57 +01:00
Finagolfin
30ba49e7fa [android][test] Fix a handful of tests and disable one CxxToSwiftToCxx bridging test
Also, make the analogous change to apple/swift-driver#1372, which gets the
sanitizer tests working on Android again, and remove the lld_lto feature in the
tests, which is now unused.
2023-08-12 16:36:35 +05:30
swift-ci
7d6771cf8e Merge remote-tracking branch 'origin/main' into rebranch 2023-08-10 15:37:51 -07:00
Egor Zhdan
3723ff1401 [cxx-interop] Add UnsafeCxxMutableRandomAccessIterator protocol
This will be used to provide a safe overload of `std::vector::erase` in Swift.

`std::vector::erase` is not currently imported into Swift because it returns a C++ iterator.

rdar://113704853
2023-08-10 19:58:51 +01:00
swift-ci
76e6b061cd Merge remote-tracking branch 'origin/main' into rebranch 2023-08-10 11:15:52 -07:00
Alex Lorenz
9b5c398023 Merge pull request #67847 from hyp/eng/class-template-variadic
[cxx-interop] re-enable class-template-variadic.swift test
2023-08-10 10:56:48 -07:00
swift-ci
70357dc938 Merge remote-tracking branch 'origin/main' into rebranch 2023-08-09 19:14:48 -07:00
Saleem Abdulrasool
9179bc5611 Merge pull request #67840 from compnerd/operator-testing
test: enable yet more C++ interop tests on Windows
2023-08-09 18:55:41 -07:00
Alex Lorenz
3581eb84ce Merge pull request #67843 from hyp/eng/rebranch_2023
C++ interop rebranch test fixes
2023-08-09 18:51:50 -07:00
Alex Lorenz
a49fd68bfd [cxx-interop] re-enable class-template-variadic.swift test 2023-08-09 17:53:37 -07:00
Alex Lorenz
0e6b1ce964 [rebranch][cxx-interop] tests, pass _LIBCPP_DISABLE_AVAILABILITY to workaround libc++ format typealias availability bug 2023-08-09 15:57:56 -07:00
Saleem Abdulrasool
68a7c1e8d3 test: enable yet more C++ interop tests on Windows
These tests should now work as the parameter passing issue has been
resolved.
2023-08-09 14:55:30 -07:00
Alex Lorenz
3569c5d6f2 [cxx-interop] Try more stdlib and overlay tests on Windows 2023-08-09 12:59:27 -07:00
zachary0kent
d240ffa340 Merge pull request #67747 from zachary0kent/sil-gen-top-level
[SILGen] Unified Entry Point Emission
2023-08-08 16:14:45 -07:00
Saleem Abdulrasool
d1b63d6969 Merge pull request #67776 from compnerd/the-missing-link
IRGen: rework linking against CxxStdlib
2023-08-08 15:08:48 -07:00
Saleem Abdulrasool
7c74a521cb Merge pull request #67797 from apple/dependents
tests: enable some tests on Windows
2023-08-08 15:08:15 -07:00
Egor Zhdan
c9720ca330 Merge pull request #67796 from apple/egorzhdan/std-optional-conflict
[cxx-interop] Adjust a test
2023-08-08 20:24:57 +01:00
Alex Lorenz
1addca37a2 Merge pull request #67685 from hyp/eng/hoping-one-day-67674-gets-fixed
[cxx-interop][windows] additional fix for indirect return in methods
2023-08-08 12:13:01 -07:00