mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
44 lines
1.3 KiB
C++
44 lines
1.3 KiB
C++
#ifndef TEST_INTEROP_CXX_CLASS_INPUTS_DESTRUCTORS_H
|
|
#define TEST_INTEROP_CXX_CLASS_INPUTS_DESTRUCTORS_H
|
|
|
|
struct DummyStruct {};
|
|
|
|
struct __attribute__((swift_attr("import_unsafe")))
|
|
HasUserProvidedDestructorAndDummy {
|
|
DummyStruct dummy;
|
|
HasUserProvidedDestructorAndDummy(DummyStruct dummy) : dummy(dummy) {}
|
|
#if __is_target_os(windows)
|
|
// On windows, force this type to be address-only.
|
|
HasUserProvidedDestructorAndDummy(const HasUserProvidedDestructorAndDummy &) {}
|
|
#endif
|
|
~HasUserProvidedDestructorAndDummy() {}
|
|
};
|
|
|
|
struct __attribute__((swift_attr("import_unsafe"))) HasUserProvidedDestructor {
|
|
int *value;
|
|
#if __is_target_os(windows)
|
|
// On windows, force this type to be address-only.
|
|
HasUserProvidedDestructor() {}
|
|
HasUserProvidedDestructor(const HasUserProvidedDestructor &other) {}
|
|
#endif
|
|
~HasUserProvidedDestructor() { *value = 42; }
|
|
};
|
|
|
|
struct HasNonTrivialImplicitDestructor {
|
|
HasUserProvidedDestructor member;
|
|
};
|
|
|
|
template <typename T>
|
|
struct TemplatedHasVirtualDestructor {
|
|
T value;
|
|
virtual ~TemplatedHasVirtualDestructor() {}
|
|
};
|
|
|
|
template <typename T>
|
|
struct DerivedTemplatedHasVirtualDestructor : TemplatedHasVirtualDestructor<T> {
|
|
};
|
|
|
|
using DerivedTemplatedHasVirtualDestructorChar = DerivedTemplatedHasVirtualDestructor<char>;
|
|
|
|
#endif // TEST_INTEROP_CXX_CLASS_INPUTS_DESTRUCTORS_H
|