Revert "[Macros] Treat FreestandingExpressionMacros as a suppressible feature"

This reverts commit b412c6c884.

Resolves rdar://108591384
This commit is contained in:
Allan Shortlidge
2023-05-01 19:41:45 -07:00
parent bde105cbf0
commit ffaa1d5dbc
5 changed files with 5 additions and 30 deletions

View File

@@ -9,26 +9,20 @@
// RUN: %FileCheck %s < %t/Macros.swiftinterface --check-prefix CHECK
// RUN: %target-swift-frontend -compile-module-from-interface %t/Macros.swiftinterface -o %t/Macros.swiftmodule
// CHECK: #if compiler(>=5.3) && $Macros
// CHECK-NEXT: #if $FreestandingExpressionMacros
// CHECK: #if compiler(>=5.3) && $Macros && $FreestandingExpressionMacros
// CHECK-NEXT: @freestanding(expression) public macro publicStringify<T>(_ value: T) -> (T, Swift.String) = #externalMacro(module: "SomeModule", type: "StringifyMacro")
// CHECK-NEXT: #else
// CHECK-NEXT: @expression public macro publicStringify<T>(_ value: T) -> (T, Swift.String) = #externalMacro(module: "SomeModule", type: "StringifyMacro")
// CHECK-NEXT: #endif
// CHECK-NEXT: #endif
@freestanding(expression) public macro publicStringify<T>(_ value: T) -> (T, String) = #externalMacro(module: "SomeModule", type: "StringifyMacro")
@freestanding(expression) public macro labeledStringify<T>(_ value: T, label: String) -> (T, String) = #externalMacro(module: "SomeModule", type: "StringifyMacro")
// CHECK: #if compiler(>=5.3) && $Macros && $FreestandingExpressionMacros
// CHECK: @freestanding(expression) public macro unlabeledStringify<T>(_ value: T, label: Swift.String) -> (T, Swift.String) = #labeledStringify(value, label: "default label")
// CHECK-NEXT: #endif
@freestanding(expression) public macro unlabeledStringify<T>(_ value: T, label: String) -> (T, String) = #labeledStringify(value, label: "default label")
// CHECK: #if compiler(>=5.3) && $Macros
// CHECK-NEXT: #if $FreestandingExpressionMacros
// CHECK: #if compiler(>=5.3) && $Macros && $FreestandingExpressionMacros
// CHECK: @freestanding(expression) public macro publicLine<T>() -> T = #externalMacro(module: "SomeModule", type: "Line") where T : Swift.ExpressibleByIntegerLiteral
// CHECK-NEXT: #else
// CHECK: @expression public macro publicLine<T>() -> T = #externalMacro(module: "SomeModule", type: "Line") where T : Swift.ExpressibleByIntegerLiteral
// CHECK-NEXT: #endif
// CHECK-NEXT: #endif
@freestanding(expression) public macro publicLine<T: ExpressibleByIntegerLiteral>() -> T = #externalMacro(module: "SomeModule", type: "Line")