Skip to content

Commit 6ca531c

Browse files
authored
Merge pull request #74404 from DougGregor/documentation-macro-attr-loc
Provide property source locations for `@_documentation`.
2 parents a1708ef + 470bdc6 commit 6ca531c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/Parse/ParseDecl.cpp

Lines changed: 1 addition & 1 deletion
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

Lines changed: 5 additions & 0 deletions
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)