Skip to content

Commit f624430

Browse files
authored
Merge pull request #24034 from kitasuke/remove_deprecated_decl_attributes_support
[Gardening] Remove deprecated decl attributes support
2 parents 8c22a1a + d35cbee commit f624430

File tree

3 files changed

+1
-45
lines changed

3 files changed

+1
-45
lines changed

include/swift/AST/DiagnosticsParse.def

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,11 +1394,6 @@ ERROR(attr_objc_expected_rparen,none,
13941394
"expected ')' after name for @objc", ())
13951395
ERROR(attr_objc_empty_name,none,
13961396
"expected name within parentheses of @objc attribute", ())
1397-
ERROR(attr_nskeyedarchiverclassname_removed, none,
1398-
"@NSKeyedArchiverClassName has been removed; use @objc instead", ())
1399-
ERROR(attr_nskeyedarchiverencodenongenericsubclassesonly_removed, none,
1400-
"@NSKeyedArchiverEncodeNonGenericSubclassesOnly is no longer necessary",
1401-
())
14021397

14031398
ERROR(attr_dynamic_replacement_expected_rparen,none,
14041399
"expected ')' after function name for @_dynamicReplacement", ())

lib/Parse/ParseDecl.cpp

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1762,8 +1762,7 @@ bool Parser::parseDeclAttribute(DeclAttributes &Attributes, SourceLoc AtLoc) {
17621762
}
17631763
};
17641764

1765-
// FIXME: This renaming happened before Swift 3, we can probably remove
1766-
// the specific fallback path at some point.
1765+
// Check if attr is availability, and suggest available instead
17671766
checkInvalidAttrName("availability", "available", DAK_Available, diag::attr_renamed);
17681767

17691768
// Check if attr is inlineable, and suggest inlinable instead
@@ -1816,38 +1815,6 @@ bool Parser::parseDeclAttribute(DeclAttributes &Attributes, SourceLoc AtLoc) {
18161815
return false;
18171816
}
18181817

1819-
// FIXME: Remove this after Swift 4.
1820-
if (DK == DAK_Count && Tok.getText() == "NSKeyedArchiverClassName") {
1821-
auto activeDiag = diagnose(Tok,diag::attr_nskeyedarchiverclassname_removed);
1822-
activeDiag.fixItReplace(Tok.getLoc(), "objc");
1823-
consumeToken();
1824-
SourceLoc lParenLoc;
1825-
if (consumeIf(tok::l_paren, lParenLoc)) {
1826-
if (Tok.is(tok::string_literal)) {
1827-
activeDiag.fixItRemoveChars(Tok.getLoc(),
1828-
Tok.getLoc().getAdvancedLoc(1));
1829-
SourceLoc endLoc = Tok.getLoc().getAdvancedLoc(Tok.getLength());
1830-
activeDiag.fixItRemoveChars(endLoc.getAdvancedLoc(-1), endLoc);
1831-
}
1832-
skipUntil(tok::r_paren);
1833-
SourceLoc rParenLoc;
1834-
parseMatchingToken(tok::r_paren, rParenLoc,
1835-
diag::attr_warn_unused_result_expected_rparen,
1836-
lParenLoc);
1837-
}
1838-
return false;
1839-
}
1840-
1841-
// FIXME: Remove this after Swift 4.
1842-
if (DK == DAK_Count &&
1843-
Tok.getText() == "NSKeyedArchiverEncodeNonGenericSubclassesOnly") {
1844-
diagnose(Tok,
1845-
diag::attr_nskeyedarchiverencodenongenericsubclassesonly_removed)
1846-
.fixItRemove(SourceRange(AtLoc, Tok.getLoc()));
1847-
consumeToken();
1848-
return false;
1849-
}
1850-
18511818
if (DK != DAK_Count && !DeclAttribute::shouldBeRejectedByParser(DK))
18521819
return parseNewDeclAttribute(Attributes, AtLoc, DK);
18531820

test/decl/protocol/conforms/nscoding.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,6 @@ private class CodingH : NSObject, AlsoNSCoding { // expected-error{{private clas
148148
func encode(coder: NSCoder) { }
149149
}
150150

151-
@NSKeyedArchiverClassName( "abc" ) // expected-error {{@NSKeyedArchiverClassName has been removed; use @objc instead}} {{2-26=objc}} {{28-29=}} {{32-33=}}
152-
class OldArchiverAttribute: NSObject {}
153-
154-
@NSKeyedArchiverEncodeNonGenericSubclassesOnly // expected-error {{@NSKeyedArchiverEncodeNonGenericSubclassesOnly is no longer necessary}} {{1-48=}}
155-
class OldArchiverAttributeGeneric<T>: NSObject {}
156-
157151
// Don't allow one to write @_staticInitializeObjCMetadata!
158152
@_staticInitializeObjCMetadata // expected-error{{unknown attribute '_staticInitializeObjCMetadata'}}
159153
class DontAllowStaticInits { }

0 commit comments

Comments
 (0)