Files
swift-mirror/test/Interop/Cxx/class/inheritance/Inputs/reference-to-derived.h
Egor Zhdan 4632d894e6 [cxx-interop] Avoid circular reference errors when importing C++ structs
When importing a C++ struct, if its owning module requires cplusplus, Swift tried to auto-conform it to certain protocols from the Cxx module. This triggers name lookup in the clang struct, specifically for `__beginUnsafe()` and `__endUnsafe` methods, which imports all of the base structs including their methods.

This moves the import of base structs out of the name lookup request, preventing cycles.

rdar://116426238
2023-10-23 12:19:05 +01:00

14 lines
126 B
C++

class E;
class C {
public:
E *getE() const;
};
class D : public C {};
class E : public D {
public:
D *getD() const;
};