mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Turning the feature "ctor of C++ foreign reference types is callable as Swift Initializers" on by default. rdar://148285972
25 lines
544 B
Swift
25 lines
544 B
Swift
// RUN: rm -rf %t
|
|
// RUN: split-file %s %t
|
|
// RUN: %target-swift-frontend -typecheck -verify -I %t/Inputs %t/test.swift -enable-experimental-cxx-interop -disable-availability-checking
|
|
|
|
//--- Inputs/module.modulemap
|
|
module Test {
|
|
header "test.h"
|
|
requires cplusplus
|
|
}
|
|
|
|
//--- Inputs/test.h
|
|
struct
|
|
__attribute__((swift_attr("import_reference")))
|
|
__attribute__((swift_attr("retain:immortal")))
|
|
__attribute__((swift_attr("release:immortal")))
|
|
HasCtor {
|
|
HasCtor(int a) {}
|
|
};
|
|
|
|
//--- test.swift
|
|
|
|
import Test
|
|
|
|
let x = HasCtor(42)
|