Files
swift-mirror/test/Interop/Cxx/class/pimpl-irgen.swift
Egor Zhdan 738c8fb6c6 [cxx-interop] Skip type metadata for C++ types that are only used in private C++ fields
This fixes compiler errors for C++ types that use pimpl idiom:
```
invalid application of 'sizeof' to an incomplete type
```

rdar://141960396
2025-01-13 12:03:35 +00:00

16 lines
461 B
Swift

// RUN: %target-swiftxx-frontend -emit-irgen %s -I %S/Inputs | %FileCheck %s
// Make sure Swift handles the C++ pointer-to-implementation idiom properly.
import PIMPL
// Trigger type metadata to be emitted by conforming C++ types to a Swift protocol.
protocol MyProto {}
extension HasPIMPL : MyProto {}
extension HasSmartPIMPL : MyProto {}
let _ = createHasPIMPL()
let _ = createHasSmartPIMPL()
// CHECK-NOT: @"get_type_metadata {{.*}}default_delete{{.*}}