[cxx-interop] use SWIFT_NOEXCEPT for Swift function prototypes

This will allow these functions to be used from C.

Also add a static_assert to verify that noexcept is actually used.
This commit is contained in:
Alex Lorenz
2022-03-13 11:08:32 -07:00
parent 2c2fa566d8
commit 858a847d27
6 changed files with 22 additions and 12 deletions

View File

@@ -14,6 +14,10 @@
#include "functions.h"
int main() {
static_assert(noexcept(Functions::passVoidReturnVoid()), "noexcept function");
static_assert(noexcept(Functions::_impl::$s9Functions014passVoidReturnC0yyF()),
"noexcept function");
Functions::passVoidReturnVoid();
Functions::passIntReturnVoid(-1);
assert(Functions::passTwoIntReturnIntNoArgLabel(1, 2) == 42);