Files
swift-mirror/test/Interop/Cxx/reference/Inputs/reference.h
zoecarver 16c8d0b4d3 [cxx-interop] Bail on parameter that are reference types to dependent types.
Currently, just like for return types, we can't import references to dependent types. Refs https://github.com/apple/swift/pull/41660.
2022-03-29 14:58:55 -07:00

41 lines
1.1 KiB
C++

#ifndef TEST_INTEROP_CXX_REFERENCE_INPUTS_REFERENCE_H
#define TEST_INTEROP_CXX_REFERENCE_INPUTS_REFERENCE_H
int getStaticInt();
int &getStaticIntRef();
int &&getStaticIntRvalueRef();
const int &getConstStaticIntRef();
const int &&getConstStaticIntRvalueRef();
void setStaticInt(int);
void setStaticIntRef(int &);
void setStaticIntRvalueRef(int &&);
void setConstStaticIntRef(const int &);
void setConstStaticIntRvalueRef(const int &&);
auto getFuncRef() -> int (&)();
auto getFuncRvalueRef() -> int (&&)();
template<class T>
struct ClassTemplate {};
template<class T>
const ClassTemplate<T> &refToDependent() { return ClassTemplate<T>(); }
// We cannot import "_Atomic" types. Make sure we fail gracefully instead of
// crashing when we have an "_Atomic" type or a reference to one.
void dontImportAtomicRef(_Atomic(int)&) { }
void takeConstRef(const int &);
template<class T>
T &refToTemplate(T &t) { return t; }
template<class T>
const T &constRefToTemplate(const T &t) { return t; }
template<class T>
void refToDependentParam(ClassTemplate<T> &param) { }
#endif // TEST_INTEROP_CXX_REFERENCE_INPUTS_REFERENCE_H