[clang] [compiler-rt] [ubsan] Improve scoped enum diagnostic printer (PR #216460)

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 16 17:29:11 PDT 2026


================
@@ -3959,18 +3959,27 @@ llvm::Constant *CodeGenFunction::EmitCheckTypeDescriptor(QualType T) {
   uint16_t TypeInfo = 0;
   bool IsBitInt = false;
 
-  if (T->isIntegerType()) {
+  // isIntegerType() never holds for scoped enums, and getAs<BitIntType> can't
+  // see through the EnumType node to a __BitInt underlying type even for
+  // unscoped enums.
+  QualType ValueTy = T;
----------------
vitalybuka wrote:

Can you please 'QualType BackupT = T;'
and operate on T as much as possible to avoid unnececary changes

https://github.com/llvm/llvm-project/pull/216460


More information about the llvm-commits mailing list