Files
swift-mirror/test/Interop/Cxx/reference/Inputs/closures.h
zoecarver caf83c2375 [cxx-interop] Import const-refs as value types when importing clang function types.
Otherwise, it will pass the value as a poitner.
2022-03-29 11:42:57 -07:00

15 lines
321 B
C

#ifndef TEST_INTEROP_CXX_CLOSURES_INPUTS_REFERENCE_H
#define TEST_INTEROP_CXX_CLOSURES_INPUTS_REFERENCE_H
inline void invokeWith42ConstRef(void (^fn)(const int&)) {
int i = 42;
fn(i);
}
inline void invokeWith42Ref(void (^fn)(int&)) {
int i = 42;
fn(i);
}
#endif // TEST_INTEROP_CXX_CLOSURES_INPUTS_REFERENCE_H