@@ -1502,6 +1502,15 @@ void Parser::ParseMicrosoftInheritanceClassAttributes(ParsedAttributes &attrs) {
1502
1502
}
1503
1503
}
1504
1504
1505
+ void Parser::ParseNullabilityClassAttributes (ParsedAttributes &attrs) {
1506
+ while (Tok.is (tok::kw__Nullable)) {
1507
+ IdentifierInfo *AttrName = Tok.getIdentifierInfo ();
1508
+ auto Kind = Tok.getKind ();
1509
+ SourceLocation AttrNameLoc = ConsumeToken ();
1510
+ attrs.addNew (AttrName, AttrNameLoc, nullptr , AttrNameLoc, nullptr , 0 , Kind);
1511
+ }
1512
+ }
1513
+
1505
1514
// / Determine whether the following tokens are valid after a type-specifier
1506
1515
// / which could be a standalone declaration. This will conservatively return
1507
1516
// / true if there's any doubt, and is appropriate for insert-';' fixits.
@@ -1683,15 +1692,21 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
1683
1692
1684
1693
ParsedAttributes attrs (AttrFactory);
1685
1694
// If attributes exist after tag, parse them.
1686
- MaybeParseAttributes (PAKM_CXX11 | PAKM_Declspec | PAKM_GNU, attrs);
1687
-
1688
- // Parse inheritance specifiers.
1689
- if (Tok.isOneOf (tok::kw___single_inheritance, tok::kw___multiple_inheritance,
1690
- tok::kw___virtual_inheritance))
1691
- ParseMicrosoftInheritanceClassAttributes (attrs);
1692
-
1693
- // Allow attributes to precede or succeed the inheritance specifiers.
1694
- MaybeParseAttributes (PAKM_CXX11 | PAKM_Declspec | PAKM_GNU, attrs);
1695
+ for (;;) {
1696
+ MaybeParseAttributes (PAKM_CXX11 | PAKM_Declspec | PAKM_GNU, attrs);
1697
+ // Parse inheritance specifiers.
1698
+ if (Tok.isOneOf (tok::kw___single_inheritance,
1699
+ tok::kw___multiple_inheritance,
1700
+ tok::kw___virtual_inheritance)) {
1701
+ ParseMicrosoftInheritanceClassAttributes (attrs);
1702
+ continue ;
1703
+ }
1704
+ if (Tok.is (tok::kw__Nullable)) {
1705
+ ParseNullabilityClassAttributes (attrs);
1706
+ continue ;
1707
+ }
1708
+ break ;
1709
+ }
1695
1710
1696
1711
// Source location used by FIXIT to insert misplaced
1697
1712
// C++11 attributes
0 commit comments