mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user