File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -8937,6 +8937,11 @@ void ClangImporter::Implementation::loadAllMembersOfRecordDecl(
8937
8937
continue ;
8938
8938
}
8939
8939
8940
+ // A friend C++ decl is not a member of the Swift type.
8941
+ if (member->getClangDecl () &&
8942
+ member->getClangDecl ()->getFriendObjectKind () != clang::Decl::FOK_None)
8943
+ continue ;
8944
+
8940
8945
// FIXME: constructors are added eagerly, but shouldn't be
8941
8946
// FIXME: subscripts are added eagerly, but shouldn't be
8942
8947
if (!isa<AccessorDecl>(member) &&
Original file line number Diff line number Diff line change
1
+ // RUN: rm -rf %t
2
+ // RUN: split-file %s %t
3
+ // RUN: %target-swift-ide-test -print-module -module-to-print=Test -I %t/Inputs -source-filename=x -enable-experimental-cxx-interop | %FileCheck %s
4
+
5
+ //--- Inputs/module.modulemap
6
+ module Test {
7
+ header " test.h "
8
+ requires cplusplus
9
+ }
10
+
11
+ //--- Inputs/test.h
12
+ struct A {
13
+ void memberInA( int x) ;
14
+ } ;
15
+
16
+ struct B {
17
+ friend void A: : memberInA( int ) ;
18
+
19
+ void memberInB( ) ;
20
+ } ;
21
+
22
+ struct C: B {
23
+ void memberInC( ) ;
24
+ } ;
25
+
26
+ // CHECK: struct A {
27
+ // CHECK: mutating func memberInA(_ x: Int32)
28
+ // CHECK-NEXT: }
29
+ // CHECK: struct B {
30
+ // CHECK: mutating func memberInB()
31
+ // CHECK-NEXT: }
32
+ // CHECK: struct C {
33
+ // CHECK: mutating func memberInC()
34
+ // CHECK-NEXT: mutating func memberInB()
35
+ // CHECK-NEXT: }
You can’t perform that action at this time.
0 commit comments