File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed
test/Interop/Cxx/class/access Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -9164,6 +9164,12 @@ void ClangImporter::Implementation::swiftify(FuncDecl *MappedDecl) {
91649164 if (!ClangDecl)
91659165 return ;
91669166
9167+ // FIXME: for private macro generated functions we do not serialize the
9168+ // SILFunction's body anywhere triggering assertions.
9169+ if (ClangDecl->getAccess () == clang::AS_protected ||
9170+ ClangDecl->getAccess () == clang::AS_private)
9171+ return ;
9172+
91679173 if (ClangDecl->getNumParams () != MappedDecl->getParameters ()->size ())
91689174 return ;
91699175
Original file line number Diff line number Diff line change 1+ // RUN: rm -rf %t
2+ // RUN: split-file %s %t
3+
4+ // RUN: %target-swift-frontend -emit-ir -I %swift_src_root/lib/ClangImporter/SwiftBridging -plugin-path %swift-plugin-dir %t/blessed.swift -module-name main -I %t/Inputs -o %t/out -Xcc -std=c++20 -cxx-interoperability-mode=default -enable-experimental-feature SafeInteropWrappers -verify
5+
6+ // REQUIRES: swift_feature_SafeInteropWrappers
7+
8+ // FIXME swift-ci linux tests do not support std::span
9+ // UNSUPPORTED: OS=linux-gnu, OS=linux-android, OS=linux-androideabi
10+
11+ //--- Inputs/swiftify-non-public.h
12+ #pragma once
13+
14+ #include " swift/bridging "
15+ #include < span>
16+
17+ using IntSpan = std : : span< const int> ;
18+
19+ class SWIFT_PRIVATE_FILEID( " main/blessed.swift " ) MyClass {
20+ private:
21+ void takesSpan( IntSpan s [ [ clang: : noescape] ] ) { }
22+ } ;
23+
24+ //--- Inputs/module.modulemap
25+ module SwiftifyNonPublic {
26+ requires cplusplus
27+ header " swiftify-non-public.h "
28+ }
29+
30+ //--- blessed.swift
31+ import CxxStdlib
32+ import SwiftifyNonPublic
33+
34+ extension MyClass {
35+ mutating func passesSpan( _ s: Span < CInt > ) {
36+ takesSpan ( s) // expected-error {{cannot convert value of type}}
37+ }
38+ }
You can’t perform that action at this time.
0 commit comments