Commit Graph

7 Commits

Author SHA1 Message Date
Arnold Schwaighofer
79894ff461 Fix test/Interop with opaque pointers 2023-07-03 03:36:07 -07:00
Arnold Schwaighofer
c1a93e0bde Move tests over to use the %use_no_opaque_pointers option 2023-06-14 10:49:48 -07:00
Ehud Adler
0f83b65f9b [cxx-interop] Remove impl for constexpr members (#60154)
* Remove impl for constexpr members

* Readd some tets

* Only remove import of static constexpr
2022-07-21 15:41:17 -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
6bc2696e24 [cxx-interop] Inline constexpr vars.
If a static variable can be evaluated at compile time, create an
accessor using that value. This means static variables will always be
inlined and removed.

Note: currently this only works with numeric types.
2021-01-08 14:22:25 -08:00
Saleem Abdulrasool
e600816d50 ClangImporter: synchronize clang and Swift
This synchronizes the C/C++ standard that Swift uses for the clang
importer with the defaults of the clang compiler.

The default for the C standard remains the same at `gnu11`.  However, if
clang was built with a different default C standard, that will be
preferred.

The default for the C++ standard is moved to C++14.  Although this is a
reduced version, it matches what the current clang compiler defaults to.
Additionally, if the user built clang with a different C++ standard,
that standard would be preferred.

Although the C++ support is a bit more conservative, the idea is that we
can be certain that the clang version fully supports this standard as it
it the default version for clang.

The test change made here replaces the use of `auto` type parameters to
templates which is a C++17 feature.  Reduce the example to a C++14
equivalent.

The clang version seems to behave differently in preventing the
synthesis of the constexpr value.  This persists into the newer clang
releases as well.  This is reasonable as the value does not need to be
exported necessarily and users will be able to materialize the value.
We use the optimizer to ensure that the value is inlined.

This also repairs the C++ interop tests on Windows with a newer C++
runtime from Microsoft.
2021-01-07 14:44:49 -08:00
Marcel Hlopko
883262771b Expose C++ static members as Swift static properties 2020-04-23 15:33:43 +02:00