mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This fixes compiler errors for C++ types that use pimpl idiom: ``` invalid application of 'sizeof' to an incomplete type ``` rdar://141960396
25 lines
366 B
C++
25 lines
366 B
C++
#include <memory>
|
|
|
|
// C++ types that use pointer-to-implementation idiom.
|
|
|
|
struct HasPIMPL {
|
|
private:
|
|
struct I;
|
|
I *ptr;
|
|
};
|
|
|
|
HasPIMPL createHasPIMPL();
|
|
|
|
struct HasSmartPIMPL {
|
|
private:
|
|
struct I;
|
|
std::unique_ptr<I> smart_ptr;
|
|
|
|
public:
|
|
HasSmartPIMPL();
|
|
HasSmartPIMPL(const HasSmartPIMPL &other);
|
|
~HasSmartPIMPL();
|
|
};
|
|
|
|
HasSmartPIMPL createHasSmartPIMPL();
|