mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
26 lines
605 B
C
26 lines
605 B
C
#ifndef TEST_INTEROP_CXX_CLASS_INPUTS_DESTRUCTORS_WITH_TEMPORARY_VALUES_H
|
|
#define TEST_INTEROP_CXX_CLASS_INPUTS_DESTRUCTORS_WITH_TEMPORARY_VALUES_H
|
|
|
|
struct Value {
|
|
void referencedByDestructor() { r(); }
|
|
|
|
double r();
|
|
};
|
|
|
|
void referencedByDestructor(Value *ptr) { ptr->referencedByDestructor(); }
|
|
|
|
struct Reference {
|
|
~Reference() {
|
|
if (ptr)
|
|
referencedByDestructor(ptr);
|
|
}
|
|
Value *ptr;
|
|
};
|
|
|
|
inline Reference getRef();
|
|
inline void takeDouble(double);
|
|
|
|
inline void testFunction() { takeDouble(getRef().ptr->r()); }
|
|
|
|
#endif // TEST_INTEROP_CXX_CLASS_INPUTS_DESTRUCTORS_WITH_TEMPORARY_VALUES_H
|