Skip to content

Commit 470bdc6

Browse files
committed
Provide property source locations for @_documentation.
This was breaking macro expansion in the weirdest way. Fixes rdar://127206128
1 parent c0c28c4 commit 470bdc6

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/Parse/ParseDecl.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2456,7 +2456,7 @@ Parser::parseDocumentationAttribute(SourceLoc atLoc, SourceLoc loc) {
24562456
StringRef finalMetadata = metadata.value_or("");
24572457

24582458
return makeParserResult(
2459-
new (Context) DocumentationAttr(loc, range, finalMetadata,
2459+
new (Context) DocumentationAttr(atLoc, range, finalMetadata,
24602460
visibility, false));
24612461
}
24622462

test/Macros/macros_diagnostics.swift

+5
Original file line numberDiff line numberDiff line change
@@ -220,3 +220,8 @@ struct SomeType {
220220
macro multipleFreestandingRoles<T>(_: T) -> Void = #externalMacro(module: "A", type: "B")
221221
// expected-warning@-1{{external macro implementation type}}
222222
// expected-error@-2{{macro can only have a single freestanding role}}
223+
224+
@_documentation(visibility: private)
225+
@attached(peer)
226+
macro Foo() = #externalMacro(module: "ThisMacroModuleDoesNotExist", type: "ThisMacroTypeDoesNotExist")
227+
// expected-warning@-1{{external macro implementation type}}

0 commit comments

Comments
 (0)