Skip to content

Commit e9a44d4

Browse files
committed
Polish
1 parent 4e5fb25 commit e9a44d4

File tree

6 files changed

+3
-40
lines changed

6 files changed

+3
-40
lines changed

include/swift/AST/Decl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -3396,7 +3396,7 @@ class StructDecl final : public NominalTypeDecl {
33963396
// with a name prefixed with `__CxxTemplateInst`. However for proper
33973397
// serialization we need to have an access to the bound generic type
33983398
// that would have produced this instantiation. This field contains
3399-
// such type.
3399+
// that type.
34003400
//
34013401
// The field is set during the typechecking at the time when we
34023402
// instantiate the C++ class template.

lib/ClangImporter/ImportDecl.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -3977,10 +3977,6 @@ namespace {
39773977
if (correctSwiftName)
39783978
markAsVariant(result, *correctSwiftName);
39793979

3980-
if (decl->isInvalidDecl()) {
3981-
return nullptr;
3982-
}
3983-
39843980
return result;
39853981
}
39863982

lib/ClangImporter/Serializability.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ class SerializationPathFinder {
7373
if (!isa<TypeAliasDecl>(swiftDecl)) {
7474
// Only accept this declaration if it round-trips.
7575
if (auto swiftClangDecl = swiftDecl->getClangDecl())
76-
if (isSameDecl(decl, swiftClangDecl))
77-
return swiftDecl;
76+
if (isSameDecl(decl, swiftClangDecl))
77+
return swiftDecl;
7878
}
7979
}
8080

lib/Serialization/DeclTypeRecordNodes.def

-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ OTHER(CLANG_TYPE, 253)
196196

197197
OTHER(DERIVATIVE_FUNCTION_CONFIGURATION, 254)
198198

199-
200199
#undef RECORD
201200
#undef DECLTYPERECORDNODES_HAS_RECORD_VAL
202201
#undef RECORD_VAL

test/Interop/Cxx/templates/Inputs/class-template-in-namespace-for-swift-module.h

-12
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,3 @@ namespace Engine {
1010
} // namespace Engine
1111

1212
#endif // TEST_INTEROP_CXX_TEMPLATES_INPUTS_CLASS_TEMPLATE_IN_NAMESPACE_FOR_SWIFT_MODULE_H
13-
14-
// RUN: %target-swift-ide-test -print-module -module-to-print=ClassTemplateInNamespace -I %S/Inputs -source-filename=x -enable-cxx-interop | %FileCheck %s
15-
16-
// CHECK: enum Space {
17-
// CHECK: struct Ship<T> {
18-
// CHECK: }
19-
// CHECK: }
20-
// CHECK: enum Engine {
21-
// CHECK: struct Turbojet {
22-
// CHECK: init()
23-
// CHECK: }
24-
// CHECK: }

test/Interop/Cxx/templates/Inputs/class-template-in-namespace.h

-20
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,3 @@ using Orbiter = Ship<void(bool)>;
1111
} // namespace Space
1212

1313
#endif // TEST_INTEROP_CXX_TEMPLATES_INPUTS_CLASS_TEMPLATE_IN_NAMESPACE_H
14-
15-
// namespace Space {
16-
// template <class T> struct Ship { T t; };
17-
// } // namespace Space
18-
19-
// namespace Engine {
20-
// struct Turbojet {};
21-
// } // namespace Engine
22-
23-
// RUN: %target-swift-ide-test -print-module -module-to-print=ClassTemplateInNamespace -I %S/Inputs -source-filename=x -enable-cxx-interop | %FileCheck %s
24-
25-
// CHECK: enum Space {
26-
// CHECK: struct Ship<T> {
27-
// CHECK: }
28-
// CHECK: }
29-
// CHECK: enum Engine {
30-
// CHECK: struct Turbojet {
31-
// CHECK: init()
32-
// CHECK: }
33-
// CHECK: }

0 commit comments

Comments
 (0)