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 @@ -8930,6 +8930,11 @@ void ClangImporter::Implementation::loadAllMembersOfRecordDecl(
89308930 continue ;
89318931 }
89328932
8933+ // A friend C++ decl is not a member of the Swift type.
8934+ if (member->getClangDecl () &&
8935+ member->getClangDecl ()->getFriendObjectKind () != clang::Decl::FOK_None)
8936+ continue ;
8937+
89338938 // FIXME: constructors are added eagerly, but shouldn't be
89348939 // FIXME: subscripts are added eagerly, but shouldn't be
89358940 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