https://github.com/ziqingluo-90 updated https://github.com/llvm/llvm-project/pull/120643
>From d1b45d14157f9adf4ec8f41840f269b262ee8da6 Mon Sep 17 00:00:00 2001 From: Ziqing Luo <ziqing_...@apple.com> Date: Thu, 19 Dec 2024 13:44:42 -0800 Subject: [PATCH] [clang][NFC] Fix the static assertion in 4797437 In the previous commit 4797437463e63ee289a1ff1904cfb7b2fe6cb4c2, 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. --- clang/include/clang/AST/Stmt.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/clang/include/clang/AST/Stmt.h b/clang/include/clang/AST/Stmt.h index 07cb63956aed0d..73dacc6dca9c75 100644 --- a/clang/include/clang/AST/Stmt.h +++ b/clang/include/clang/AST/Stmt.h @@ -114,10 +114,9 @@ class alignas(void *) Stmt { #define STMT(CLASS, PARENT) #define STMT_RANGE(BASE, FIRST, LAST) #define LAST_STMT_RANGE(BASE, FIRST, LAST) \ - static_assert( \ - llvm::isInt<NumStmtBits>(StmtClass::LAST##Class), \ - "The number of 'StmtClass'es is strictly bounded under two to " \ - "the power of 'NumStmtBits'"); + static_assert(llvm::isUInt<NumStmtBits>( \ + StmtClass::LAST##Class), "The number of 'StmtClass'es is strictly bound " \ + "by a bitfield of width NumStmtBits"); #define ABSTRACT_STMT(STMT) #include "clang/AST/StmtNodes.inc" _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits