Files
swift-mirror/test/Macros/expand_peers_hang.swift
Doug Gregor 7b3dce195a [C++ parser] Make sure break out of a parser loop on ill-formed macro expansion of members
The condition to make sure that the parser makes progress when there is
an ill-formed macro expansion to members was incorrect, causing an
infinite loop if there was at least one well-formed declaration
followed by ill-formed code (in this case, a `}`). Fix the condition.

Fixes rdar://137828917.
2024-11-06 10:15:26 -08:00

17 lines
821 B
Swift

// REQUIRES: swift_swift_parser, executable_test
// RUN: %empty-directory(%t)
// RUN: %host-build-swift -swift-version 5 -emit-library -o %t/%target-library-name(MacroDefinition) -parse-as-library -module-name=MacroDefinition %S/Inputs/syntax_macro_definitions.swift -g -no-toolchain-stdlib-rpath
// RUN: %target-typecheck-verify-swift -swift-version 5 -load-plugin-library %t/%target-library-name(MacroDefinition) -parse-as-library -disable-availability-checking
@attached(peer, names: named(BadThing))
macro HangingMacro() = #externalMacro(module: "MacroDefinition", type: "HangingMacro")
// expected-note@+1{{in declaration of 'Foo'}}
class Foo {
init() {}
// expected-note@+1 2{{in expansion of macro 'HangingMacro' on property 'result' here}}
@HangingMacro var result: Int // This comment makes it hang.
}