Commit Graph

16 Commits

Author SHA1 Message Date
susmonteiro
b7c5a47898 [cxx-interop] Fix crash when operator doesn't name parameter in header 2025-01-28 16:26:27 +00: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
Anthony Latsis
a65f1a161e Gardening: Migrate test suite to GH issues: Interop 2022-08-31 05:20:25 +03:00
Ehud Adler
e7fe6f0fe7 Fix tests and re-enable support for CXX operators 2022-05-21 21:28:03 -04:00
zoecarver
839839f924 [cxx-interop] Rename enable-cxx-interop -> enable-experimental-cxx-interop.
Also removes the driver flag, this will now also always be guarded on `-Xfrontend`.
2022-04-07 19:15:25 -07:00
zoecarver
f652361af3 [cxx-interop] Remove 'support' for importing C++ operators.
This does not include subscript operators.

Before this is re-enabled operators need to be re-implemented. Right now they are the source of a lot of bugs. They cause frequent crashes and mis compiles. Also, templated operators insert a lot of names into global lookup which causes problems.

They also don't work on Windows.
2022-03-30 15:39:35 -07:00
Saleem Abdulrasool
0d95706f74 test: partially enable some C++ interop tests on Windows
This enables the majority of the operator tests on Windows as these now
pass.  However, we cannot enable all of the tests, a few of them crash
due to invalid parameter ordering due to bugs in IRGen with C++ interop.
2022-01-17 08:56:51 -08:00
Egor Zhdan
a8f126f7cd C++ Interop: import const methods as non-mutating
This change makes ClangImporter import some C++ member functions as non-mutating, given that they satisfy two requirements:
* the function itself is marked as `const`
* the parent struct doesn't contain any `mutable` members

`get` accessors of subscript operators are now also imported as non-mutating if the C++ `operator[]` satisfies the requirements above.

Fixes SR-12795.
2021-07-25 15:18:33 +03:00
Puyan Lotfi
864b3a47e3 [cxx-interop] Implement operator[] for value return types (SR-14351).
This builds on top of the work of Egor Zhdan. It implements
`T operator[]` and does so largely by taking a path very much like the
`const T &operator[]` path.
2021-04-08 00:18:27 -04:00
Egor Zhdan
586c675286 C++ Interop: import subscript operators
This change adds support for calling `operator[]` from Swift code via a synthesized Swift subscript.

Fixes SR-12598.
2021-03-21 19:25:41 +03:00
Egor Zhdan
7141ae24cf C++ Interop: import call operators
This change adds support for calling `operator()` from Swift code.

As the C++ interop manifesto describes, `operator()` is imported into Swift as `callAsFunction`.
2021-03-02 21:13:57 +03:00
Egor Zhdan
6d5eba92b9 C++ Interop: cleanup operator tests (NFC) 2021-02-25 01:16:49 +03:00
Saleem Abdulrasool
9ba7bf78db Interop: use new target-clangxx for building C++ code
This enables control over the C++ flags used during testing for the C++
interop from a single location rather than having to alter all the
tests.
2021-01-12 08:29:24 -08:00
Saleem Abdulrasool
f5a08e45bc Interop: restore -std=c++11 for a few tests
Restore the explicit C++ standard for these tests as the C++ compiler
invocation on Darwin uses the system compiler rather than the just built
clang, which may be sufficiently different to have different default
standards.

This will be cleaned up with the next change to introduce a new
`%target-clangxx` to control the C++ standard.
2021-01-11 11:01:44 -08:00
Saleem Abdulrasool
21732c9551 Interop: remove unnecessary C++ standard
Do not override the C++ standard explicitly when running the tests.
This will eventually be useful in allowing tests to run against
different C++ standards.
2021-01-11 08:57:56 -08:00
Michael Forster
d530e36236 Add tests for C++ out-of-line member operators (#32718) 2020-07-07 19:26:23 +02:00