Commit Graph

111 Commits

Author SHA1 Message Date
Martin Boehme
1607ecfb0a Fix warnings in loadable-types.h.
The copy and move assignment operators weren't returning anything and
were hence producing "non-void function does not return a value"
warnings.

As the test doesn't actually need a definition for these operators, I've
removed the definition and simply declared them.
2020-05-20 08:08:51 +02:00
Michael Forster
e69abeba53 Classify C++ structs as loadable or address-only (#31707)
* Classify C++ structs as loadable or address-only

C++ structs are only loadable if they are trivially copyable.

Resolves SR-12472.
2020-05-13 17:16:47 +02:00
Michael Forster
07c9fdd9e6 Synthesize memberwise initializers despite member functions
Previously unimportable member functions inhibited the synthesis of
memberwise initializers.
2020-05-08 14:26:21 +02:00
Dmitri Gribenko
e355430927 Merge pull request #31619 from MForster/m/memberwise-initializer
Synthesize memberwise initializers despite AccessSpecDecl
2020-05-08 01:07:49 +02:00
Dmitri Gribenko
53055fa73c Merge pull request #31617 from martinboehme/cxx-protocol-conformance
Add a test that imported C++ classes can conform to protocols
2020-05-07 19:46:26 +02:00
Michael Forster
d611b4c4f5 Synthesize memberwise initializers despite AccessSpecDecl
Previously the mere presence of `public:` or `private:` inhibited the
synthesis of memberwise initializers.
2020-05-07 17:44:41 +02:00
Martin Boehme
6224909d37 Add a test that imported C++ classes can conform to protocols.
Currently, trying to do this causes an assertion failure in SILGen, so the
corresponding line in the SILGen test is commented out.

See https://bugs.swift.org/browse/SR-12750
2020-05-07 14:43:21 +02:00
Marcel Hlopko
2fbcf184ed Add header guards to test/Interop 2020-04-30 16:13:33 +02:00
Marcel Hlopko
6c9ccbc59b Add header guards for test input headers 2020-04-30 15:49:20 +02:00
Michael Forster
f609a7cbb4 Unify layout for C++ interop tests
This was discussed here:
https://forums.swift.org/t/reorganize-swift-compiler-tests-for-c-objc-c-interop/34411

Resolves: [SR-12475](https://bugs.swift.org/browse/SR-12475)
2020-04-06 09:38:18 +02:00
Michael Forster
98bbb81f82 [C++] Make const member variables read-only
This imports const members of C++ structs/classes stored properties with
an inaccessible setter.

Note that in C++ there are ways to change the values of const members,
so we don't use `WriteImplKind::Immutable` storage.

Resolves: [SR-12463](https://bugs.swift.org/browse/SR-12463)
2020-04-03 13:15:33 +02:00