Skip to content

Commit 583efb2

Browse files
committed
Make sure we don't accidentally overflow the DeclAttrOptions bitfield.
1 parent c4e6e6d commit 583efb2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/swift/AST/Attr.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,10 @@ class DeclAttribute : public AttributeBase {
291291
OnAnyClangDecl = 1ull << (unsigned(DeclKindIndex::Last_Decl) + 17),
292292
};
293293

294+
static_assert(
295+
(unsigned(DeclKindIndex::Last_Decl) + 17) < 64,
296+
"Overflow decl attr options bitfields");
297+
294298
LLVM_READNONE
295299
static uint64_t getOptions(DeclAttrKind DK);
296300

0 commit comments

Comments
 (0)