diff --git a/lib/PrintAsClang/PrintClangValueType.cpp b/lib/PrintAsClang/PrintClangValueType.cpp index 35ae2ede67ed1..93c2af4990536 100644 --- a/lib/PrintAsClang/PrintClangValueType.cpp +++ b/lib/PrintAsClang/PrintClangValueType.cpp @@ -586,7 +586,7 @@ void ClangValueTypePrinter::printTypePrecedingGenericTraits( if (printer.printNominalTypeOutsideMemberDeclTemplateSpecifiers(typeDecl)) os << "template<>\n"; - os << "static inline const constexpr bool isUsableInGenericContext<"; + os << "inline const constexpr bool isUsableInGenericContext<"; printer.printNominalTypeReference(typeDecl, /*moduleContext=*/nullptr); os << "> = "; @@ -635,7 +635,7 @@ void ClangValueTypePrinter::printTypeGenericTraits( if (typeDecl->hasClangNode()) { // FIXME: share the code. os << "template<>\n"; - os << "static inline const constexpr bool isUsableInGenericContext<"; + os << "inline const constexpr bool isUsableInGenericContext<"; printer.printClangTypeReference(typeDecl->getClangDecl()); os << "> = true;\n"; } @@ -670,7 +670,7 @@ void ClangValueTypePrinter::printTypeGenericTraits( if (typeDecl->hasClangNode()) { os << "template<>\n"; - os << "static inline const constexpr bool isSwiftBridgedCxxRecord<"; + os << "inline const constexpr bool isSwiftBridgedCxxRecord<"; printer.printClangTypeReference(typeDecl->getClangDecl()); os << "> = true;\n"; } @@ -679,7 +679,7 @@ void ClangValueTypePrinter::printTypeGenericTraits( assert(NTD && "not a nominal type?"); if (printer.printNominalTypeOutsideMemberDeclTemplateSpecifiers(NTD)) os << "template<>\n"; - os << "static inline const constexpr bool isValueType<"; + os << "inline const constexpr bool isValueType<"; printer.printBaseName(typeDecl->getModuleContext()); os << "::"; printer.printNominalTypeReference(NTD, moduleContext); @@ -690,7 +690,7 @@ void ClangValueTypePrinter::printTypeGenericTraits( assert(!isa(typeDecl) && !typeDecl->hasClangNode()); if (printer.printNominalTypeOutsideMemberDeclTemplateSpecifiers(NTD)) os << "template<>\n"; - os << "static inline const constexpr bool isOpaqueLayout<"; + os << "inline const constexpr bool isOpaqueLayout<"; printer.printNominalTypeReference(NTD, /*moduleContext=*/nullptr); os << "> = true;\n"; diff --git a/lib/PrintAsClang/PrintSwiftToClangCoreScaffold.cpp b/lib/PrintAsClang/PrintSwiftToClangCoreScaffold.cpp index bff4da1eadeda..2781a528f9a6a 100644 --- a/lib/PrintAsClang/PrintSwiftToClangCoreScaffold.cpp +++ b/lib/PrintAsClang/PrintSwiftToClangCoreScaffold.cpp @@ -202,7 +202,7 @@ void printPrimitiveGenericTypeTraits(raw_ostream &os, ASTContext &astContext, } os << "template<>\n"; - os << "static inline const constexpr bool isUsableInGenericContext<" + os << "inline const constexpr bool isUsableInGenericContext<" << typeInfo.name << "> = true;\n\n"; os << "template<>\nstruct TypeMetadataTrait<" << typeInfo.name << "> {\n" diff --git a/test/Interop/CxxToSwiftToCxx/bridge-cxx-struct-back-to-cxx.swift b/test/Interop/CxxToSwiftToCxx/bridge-cxx-struct-back-to-cxx.swift index 6f1106a64d7e6..4d100fd7f1127 100644 --- a/test/Interop/CxxToSwiftToCxx/bridge-cxx-struct-back-to-cxx.swift +++ b/test/Interop/CxxToSwiftToCxx/bridge-cxx-struct-back-to-cxx.swift @@ -217,7 +217,7 @@ public struct Strct { // CHECK-NEXT: #pragma clang diagnostic push // CHECK-NEXT: #pragma clang diagnostic ignored "-Wc++17-extensions" // CHECK-NEXT: template<> -// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext = true; +// CHECK-NEXT: inline const constexpr bool isUsableInGenericContext = true; // CHECK-NEXT: template<> // CHECK-NEXT: struct TypeMetadataTrait { // CHECK-NEXT: static SWIFT_INLINE_PRIVATE_HELPER void * _Nonnull getTypeMetadata() { @@ -226,7 +226,7 @@ public struct Strct { // CHECK-NEXT: }; // CHECK-NEXT: namespace _impl{ // CHECK-NEXT: template<> -// CHECK-NEXT: static inline const constexpr bool isSwiftBridgedCxxRecord = true; +// CHECK-NEXT: inline const constexpr bool isSwiftBridgedCxxRecord = true; // CHECK-NEXT: } // namespace // CHECK-NEXT: #pragma clang diagnostic pop // CHECK-NEXT: } // namespace swift @@ -256,7 +256,7 @@ public struct Strct { // CHECK-NEXT: #pragma clang diagnostic push // CHECK-NEXT: #pragma clang diagnostic ignored "-Wc++17-extensions" // CHECK-NEXT: template<> -// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext = true; +// CHECK-NEXT: inline const constexpr bool isUsableInGenericContext = true; // CHECK-NEXT: template<> // CHECK-NEXT: struct TypeMetadataTrait { // CHECK-NEXT: static SWIFT_INLINE_PRIVATE_HELPER void * _Nonnull getTypeMetadata() { @@ -265,7 +265,7 @@ public struct Strct { // CHECK-NEXT: }; // CHECK-NEXT: namespace _impl{ // CHECK-NEXT: template<> -// CHECK-NEXT: static inline const constexpr bool isSwiftBridgedCxxRecord = true; +// CHECK-NEXT: inline const constexpr bool isSwiftBridgedCxxRecord = true; // CHECK-NEXT: } // namespace // CHECK-NEXT: #pragma clang diagnostic pop // CHECK-NEXT: } // namespace swift diff --git a/test/Interop/SwiftToCxx/class/swift-class-in-cxx.swift b/test/Interop/SwiftToCxx/class/swift-class-in-cxx.swift index 2a774b7fc6c11..8c3da43fd2a51 100644 --- a/test/Interop/SwiftToCxx/class/swift-class-in-cxx.swift +++ b/test/Interop/SwiftToCxx/class/swift-class-in-cxx.swift @@ -38,7 +38,7 @@ public final class ClassWithIntField { // CHECK-NEXT: #pragma clang diagnostic push // CHECK-NEXT: #pragma clang diagnostic ignored "-Wc++17-extensions" // CHECK-NEXT: template<> -// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext = true; +// CHECK-NEXT: inline const constexpr bool isUsableInGenericContext = true; // CHECK-NEXT: #pragma clang diagnostic pop // CHECK-NEXT: } // namespace swift diff --git a/test/Interop/SwiftToCxx/core/swift-impl-defs-in-cxx-darwin64bit.swift b/test/Interop/SwiftToCxx/core/swift-impl-defs-in-cxx-darwin64bit.swift index 749edab999137..2c9d5ca1cb5ac 100644 --- a/test/Interop/SwiftToCxx/core/swift-impl-defs-in-cxx-darwin64bit.swift +++ b/test/Interop/SwiftToCxx/core/swift-impl-defs-in-cxx-darwin64bit.swift @@ -40,7 +40,7 @@ // CHECK-NEXT: } // CHECK-NEXT: #endif -// CHECK: static inline const constexpr bool isUsableInGenericContext = true; +// CHECK: inline const constexpr bool isUsableInGenericContext = true; // CHECK-EMPTY: // CHECK-NEXT: template<> // CHECK-NEXT: struct TypeMetadataTrait { @@ -50,7 +50,7 @@ // CHECK-NEXT: }; // CHECK-EMPTY: // CHECK-NEXT: template<> -// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext = true; +// CHECK-NEXT: inline const constexpr bool isUsableInGenericContext = true; // CHECK-EMPTY: // CHECK-NEXT: template<> // CHECK-NEXT: struct TypeMetadataTrait { @@ -60,7 +60,7 @@ // CHECK-NEXT: }; // CHECK-EMPTY: // CHECK-NEXT: template<> -// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext = true; +// CHECK-NEXT: inline const constexpr bool isUsableInGenericContext = true; // CHECK-EMPTY: // CHECK-NEXT: template<> // CHECK-NEXT: struct TypeMetadataTrait { diff --git a/test/Interop/SwiftToCxx/core/swift-impl-defs-in-cxx.swift b/test/Interop/SwiftToCxx/core/swift-impl-defs-in-cxx.swift index d98a9b28d6022..ccb816392298e 100644 --- a/test/Interop/SwiftToCxx/core/swift-impl-defs-in-cxx.swift +++ b/test/Interop/SwiftToCxx/core/swift-impl-defs-in-cxx.swift @@ -104,7 +104,7 @@ // CHECK-NEXT: #pragma clang diagnostic push // CHECK-NEXT: #pragma clang diagnostic ignored "-Wc++17-extensions" // CHECK-NEXT: template<> -// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext = true; +// CHECK-NEXT: inline const constexpr bool isUsableInGenericContext = true; // CHECK-EMPTY: // CHECK-NEXT: template<> // CHECK-NEXT: struct TypeMetadataTrait { @@ -114,7 +114,7 @@ // CHECK-NEXT: }; // CHECK-EMPTY: // CHECK-NEXT: template<> -// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext = true; +// CHECK-NEXT: inline const constexpr bool isUsableInGenericContext = true; // CHECK-EMPTY: // CHECK-NEXT: template<> // CHECK-NEXT: struct TypeMetadataTrait { @@ -124,7 +124,7 @@ // CHECK-NEXT: }; // CHECK-EMPTY: // CHECK-NEXT: template<> -// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext = true; +// CHECK-NEXT: inline const constexpr bool isUsableInGenericContext = true; // CHECK-EMPTY: // CHECK-NEXT: template<> // CHECK-NEXT: struct TypeMetadataTrait { @@ -134,7 +134,7 @@ // CHECK-NEXT: }; // CHECK-EMPTY: // CHECK-NEXT: template<> -// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext = true; +// CHECK-NEXT: inline const constexpr bool isUsableInGenericContext = true; // CHECK-EMPTY: // CHECK-NEXT: template<> // CHECK-NEXT: struct TypeMetadataTrait { @@ -144,7 +144,7 @@ // CHECK-NEXT: }; // CHECK-EMPTY: // CHECK-NEXT: template<> -// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext = true; +// CHECK-NEXT: inline const constexpr bool isUsableInGenericContext = true; // CHECK-EMPTY: // CHECK-NEXT: template<> // CHECK-NEXT: struct TypeMetadataTrait { @@ -154,7 +154,7 @@ // CHECK-NEXT: }; // CHECK-EMPTY: // CHECK-NEXT: template<> -// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext = true; +// CHECK-NEXT: inline const constexpr bool isUsableInGenericContext = true; // CHECK-EMPTY: // CHECK-NEXT: template<> // CHECK-NEXT: struct TypeMetadataTrait { @@ -164,7 +164,7 @@ // CHECK-NEXT: }; // CHECK-EMPTY: // CHECK-NEXT: template<> -// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext = true; +// CHECK-NEXT: inline const constexpr bool isUsableInGenericContext = true; // CHECK-EMPTY: // CHECK-NEXT: template<> // CHECK-NEXT: struct TypeMetadataTrait { @@ -174,7 +174,7 @@ // CHECK-NEXT: }; // CHECK-EMPTY: // CHECK-NEXT: template<> -// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext = true; +// CHECK-NEXT: inline const constexpr bool isUsableInGenericContext = true; // CHECK-EMPTY: // CHECK-NEXT: template<> // CHECK-NEXT: struct TypeMetadataTrait { @@ -184,7 +184,7 @@ // CHECK-NEXT: }; // CHECK-EMPTY: // CHECK-NEXT: template<> -// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext = true; +// CHECK-NEXT: inline const constexpr bool isUsableInGenericContext = true; // CHECK-EMPTY: // CHECK-NEXT: template<> // CHECK-NEXT: struct TypeMetadataTrait { @@ -194,7 +194,7 @@ // CHECK-NEXT: }; // CHECK-EMPTY: // CHECK-NEXT: template<> -// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext = true; +// CHECK-NEXT: inline const constexpr bool isUsableInGenericContext = true; // CHECK-EMPTY: // CHECK-NEXT: template<> // CHECK-NEXT: struct TypeMetadataTrait { @@ -204,7 +204,7 @@ // CHECK-NEXT: }; // CHECK-EMPTY: // CHECK-NEXT: template<> -// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext = true; +// CHECK-NEXT: inline const constexpr bool isUsableInGenericContext = true; // CHECK-EMPTY: // CHECK-NEXT: template<> // CHECK-NEXT: struct TypeMetadataTrait { @@ -214,7 +214,7 @@ // CHECK-NEXT: }; // CHECK-EMPTY: // CHECK-NEXT: template<> -// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext = true; +// CHECK-NEXT: inline const constexpr bool isUsableInGenericContext = true; // CHECK-EMPTY: // CHECK-NEXT: template<> // CHECK-NEXT: struct TypeMetadataTrait { diff --git a/test/Interop/SwiftToCxx/generics/generic-enum-in-cxx.swift b/test/Interop/SwiftToCxx/generics/generic-enum-in-cxx.swift index 7d057144d275b..de656a4257a17 100644 --- a/test/Interop/SwiftToCxx/generics/generic-enum-in-cxx.swift +++ b/test/Interop/SwiftToCxx/generics/generic-enum-in-cxx.swift @@ -102,7 +102,7 @@ public func inoutConcreteOpt(_ x: inout GenericOpt) { // CHECK-NEXT: #endif // CHECK-NEXT: class SWIFT_SYMBOL("s:8Generics17GenericCustomTypeO") GenericCustomType; -// CHECK: static inline const constexpr bool isOpaqueLayout> = true; +// CHECK: inline const constexpr bool isOpaqueLayout> = true; // CHECK: template @@ -116,7 +116,7 @@ public func inoutConcreteOpt(_ x: inout GenericOpt) { // CHECK-NEXT: #ifdef __cpp_concepts // CHECK-NEXT: requires swift::isUsableInGenericContext // CHECK-NEXT: #endif -// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext> = isUsableInGenericContext; +// CHECK-NEXT: inline const constexpr bool isUsableInGenericContext> = isUsableInGenericContext; // CHECK: template // CHECK-NEXT: #ifdef __cpp_concepts diff --git a/test/Interop/SwiftToCxx/generics/generic-struct-in-cxx.swift b/test/Interop/SwiftToCxx/generics/generic-struct-in-cxx.swift index c324d615e54db..6864d15c59ba9 100644 --- a/test/Interop/SwiftToCxx/generics/generic-struct-in-cxx.swift +++ b/test/Interop/SwiftToCxx/generics/generic-struct-in-cxx.swift @@ -210,7 +210,7 @@ public func inoutConcretePair(_ x: UInt16, _ y: inout GenericPair && swift::isUsableInGenericContext // CHECK-NEXT: #endif // __cpp_concepts -// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext> = isUsableInGenericContext && isUsableInGenericContext; +// CHECK-NEXT: inline const constexpr bool isUsableInGenericContext> = isUsableInGenericContext && isUsableInGenericContext; // CHECK: template // CHECK-NEXT: #ifdef __cpp_concepts @@ -284,12 +284,12 @@ public func inoutConcretePair(_ x: UInt16, _ y: inout GenericPair && swift::isUsableInGenericContext // CHECK-NEXT: #endif // __cpp_concepts -// CHECK-NEXT: static inline const constexpr bool isValueType> = true; +// CHECK-NEXT: inline const constexpr bool isValueType> = true; // CHECK-NEXT: template // CHECK-NEXT: #ifdef __cpp_concepts // CHECK-NEXT: requires swift::isUsableInGenericContext && swift::isUsableInGenericContext // CHECK-NEXT: #endif // __cpp_concepts -// CHECK-NEXT: static inline const constexpr bool isOpaqueLayout> = true; +// CHECK-NEXT: inline const constexpr bool isOpaqueLayout> = true; // CHECK-NEXT: template // CHECK-NEXT: #ifdef __cpp_concepts // CHECK-NEXT: requires swift::isUsableInGenericContext && swift::isUsableInGenericContext diff --git a/test/Interop/SwiftToCxx/generics/generic-type-traits-fwd.swift b/test/Interop/SwiftToCxx/generics/generic-type-traits-fwd.swift index 664d9f9cbc516..ceef8e709d4e4 100644 --- a/test/Interop/SwiftToCxx/generics/generic-type-traits-fwd.swift +++ b/test/Interop/SwiftToCxx/generics/generic-type-traits-fwd.swift @@ -31,10 +31,10 @@ public struct LaterGeneric { // CHECK: class SWIFT_SYMBOL("s:8Generics12LaterGenericV") LaterGeneric; // CHECK: class SWIFT_SYMBOL("s:8Generics16ComesFirstStructV") ComesFirstStruct; -// CHECK: static inline const constexpr bool isUsableInGenericContext = true; +// CHECK: inline const constexpr bool isUsableInGenericContext = true; // CHECK: class SWIFT_SYMBOL("s:8Generics14ComesFirstEnumO") ComesFirstEnum; -// CHECK: static inline const constexpr bool isUsableInGenericContext = true; +// CHECK: inline const constexpr bool isUsableInGenericContext = true; // CHECK: class SWIFT_SYMBOL("s:8Generics14ComesFirstEnumO") ComesFirstEnum final { // CHECK: LaterGeneric returnsLaterOpt() const SWIFT_SYMBOL("s:8Generics14ComesFirstEnumO15returnsLaterOptAA0F7GenericVyACGyF"); diff --git a/test/Interop/SwiftToCxx/structs/resilient-struct-in-cxx.swift b/test/Interop/SwiftToCxx/structs/resilient-struct-in-cxx.swift index 02e9f0c17e2f1..2233524dbfab6 100644 --- a/test/Interop/SwiftToCxx/structs/resilient-struct-in-cxx.swift +++ b/test/Interop/SwiftToCxx/structs/resilient-struct-in-cxx.swift @@ -30,7 +30,7 @@ public struct FirstSmallStruct { // CHECK: class SWIFT_SYMBOL("s:7Structs16FirstSmallStructV") FirstSmallStruct; // CHECK: template<> -// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext = true; +// CHECK-NEXT: inline const constexpr bool isUsableInGenericContext = true; // CHECK: class SWIFT_SYMBOL("s:7Structs16FirstSmallStructV") FirstSmallStruct final { // CHECK-NEXT: public: @@ -91,9 +91,9 @@ public struct FirstSmallStruct { // CHECK-NEXT: }; // CHECK-NEXT: namespace _impl{ // CHECK-NEXT: template<> -// CHECK-NEXT: static inline const constexpr bool isValueType = true; +// CHECK-NEXT: inline const constexpr bool isValueType = true; // CHECK-NEXT: template<> -// CHECK-NEXT: static inline const constexpr bool isOpaqueLayout = true; +// CHECK-NEXT: inline const constexpr bool isOpaqueLayout = true; // CHECK-NEXT: template<> // CHECK-NEXT: struct implClassFor { using type = Structs::_impl::_impl_FirstSmallStruct; }; // CHECK-NEXT: } // namespace diff --git a/test/Interop/SwiftToCxx/structs/swift-struct-in-cxx.swift b/test/Interop/SwiftToCxx/structs/swift-struct-in-cxx.swift index 1081a75c970ef..9e0e95ede0e6b 100644 --- a/test/Interop/SwiftToCxx/structs/swift-struct-in-cxx.swift +++ b/test/Interop/SwiftToCxx/structs/swift-struct-in-cxx.swift @@ -16,7 +16,7 @@ // CHECK-NEXT: #pragma clang diagnostic push // CHECK-NEXT: #pragma clang diagnostic ignored "-Wc++17-extensions" // CHECK-NEXT: template<> -// CHECK-NEXT: static inline const constexpr bool isUsableInGenericContext = true; +// CHECK-NEXT: inline const constexpr bool isUsableInGenericContext = true; // CHECK-NEXT: #pragma clang diagnostic pop // CHECK-NEXT: } // namespace swift @@ -112,7 +112,7 @@ // CHECK-NEXT: }; // CHECK-NEXT: namespace _impl{ // CHECK-NEXT: template<> -// CHECK-NEXT: static inline const constexpr bool isValueType = true; +// CHECK-NEXT: inline const constexpr bool isValueType = true; // CHECK-NEXT: template<> // CHECK-NEXT: struct implClassFor { using type = Structs::_impl::_impl_StructWithIntField; }; // CHECK-NEXT: } // namespace