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 @@ -9208,6 +9208,12 @@ void ClangImporter::Implementation::swiftify(AbstractFunctionDecl *MappedDecl) {
92089208 if (!ClangDecl)
92099209 return ;
92109210
9211+ // FIXME: for private macro generated functions we do not serialize the
9212+ // SILFunction's body anywhere triggering assertions.
9213+ if (ClangDecl->getAccess () == clang::AS_protected ||
9214+ ClangDecl->getAccess () == clang::AS_private)
9215+ return ;
9216+
92119217 if (ClangDecl->getNumParams () != MappedDecl->getParameters ()->size ())
92129218 return ;
92139219
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