Files
swift-mirror/test/Interop/Cxx/class/invalid-class-errors.swift
zoecarver 3498ff9765 [cxx-interop] Remove UnsafeLifetimeOperation record semantic kind.
This makes "owned" the default kind for records that have custom copy constructors and no pointer-members.
2022-07-18 17:15:15 -04:00

32 lines
928 B
Swift

// RUN: rm -rf %t
// RUN: split-file %s %t
// RUN: not %target-swift-frontend -typecheck -I %t/Inputs %t/test.swift -enable-experimental-cxx-interop 2>&1 | %FileCheck %s
//--- Inputs/module.modulemap
module Test {
header "test.h"
requires cplusplus
}
//--- Inputs/test.h
struct X;
struct A {
A(const A&) = delete;
};
struct __attribute__((swift_attr("import_unsafe"))) B {
B(const B&) = delete;
};
//--- test.swift
import Test
// CHECK: note: record 'X' is not defined (incomplete)
public func test(x: X) { }
// CHECK: note: record 'A' is not automatically importable: does not have a copy constructor or destructor. Refer to the C++ Interop User Manual to classify this type.
public func test(x: A) { }
// CHECK: note: record 'B' is not automatically importable: does not have a copy constructor or destructor. Refer to the C++ Interop User Manual to classify this type.
public func test(x: B) { }