Skip to content

Commit 399c3a7

Browse files
authored
[clang][NFC] Fix the static assertion in 4797437 (#120643)
In the previous commit 4797437, I used `llvm::isInt<NumStmtBits>(StmtClass::LAST##Class)` to test if `StmtClass` is strictly bounded by the an unsigned integer of 'NumStmtBits'. That is incorrect as `llvm::isInt` tests for signed integers. This commit fixes it. (rdar://141555357)
1 parent 21a6dbd commit 399c3a7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

clang/include/clang/AST/Stmt.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,9 @@ class alignas(void *) Stmt {
114114
#define STMT(CLASS, PARENT)
115115
#define STMT_RANGE(BASE, FIRST, LAST)
116116
#define LAST_STMT_RANGE(BASE, FIRST, LAST) \
117-
static_assert( \
118-
llvm::isInt<NumStmtBits>(StmtClass::LAST##Class), \
119-
"The number of 'StmtClass'es is strictly bounded under two to " \
120-
"the power of 'NumStmtBits'");
117+
static_assert(llvm::isUInt<NumStmtBits>(StmtClass::LAST##Class), \
118+
"The number of 'StmtClass'es is strictly bound " \
119+
"by a bitfield of width NumStmtBits");
121120
#define ABSTRACT_STMT(STMT)
122121
#include "clang/AST/StmtNodes.inc"
123122

0 commit comments

Comments
 (0)