Skip to content

Commit 14668db

Browse files
committed
Update LAST_DECL_ATTR and add verification to ensure it is always updated
1 parent 5d5627a commit 14668db

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

include/swift/AST/DeclAttr.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ DECL_ATTR(lifetime, Lifetime,
510510
OnAccessor | OnConstructor | OnFunc | OnSubscript | LongAttribute | ABIBreakingToAdd | ABIStableToRemove | APIBreakingToAdd | APIStableToRemove,
511511
161)
512512

513-
LAST_DECL_ATTR(Unsafe)
513+
LAST_DECL_ATTR(Lifetime)
514514

515515
#undef DECL_ATTR_ALIAS
516516
#undef CONTEXTUAL_DECL_ATTR_ALIAS

lib/AST/Attr.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
using namespace swift;
4040

4141
#define DECL_ATTR(_, Id, ...) \
42+
static_assert(DeclAttrKind::Id <= DeclAttrKind::Last_DeclAttr); \
4243
static_assert(IsTriviallyDestructible<Id##Attr>::value, \
4344
"Attrs are BumpPtrAllocated; the destructor is never called");
4445
#include "swift/AST/DeclAttr.def"

0 commit comments

Comments
 (0)