[clang] 27f5c00 - [clang][Interp] Fix a build failure on Windows

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Sun Jul 14 11:15:28 PDT 2024


Author: Timm Bäder
Date: 2024-07-14T20:15:20+02:00
New Revision: 27f5c00c607e08b3cdf37f3bf9f4ccf156de2ab4

URL: https://github.com/llvm/llvm-project/commit/27f5c00c607e08b3cdf37f3bf9f4ccf156de2ab4
DIFF: https://github.com/llvm/llvm-project/commit/27f5c00c607e08b3cdf37f3bf9f4ccf156de2ab4.diff

LOG: [clang][Interp] Fix a build failure on Windows

The usual ambiguous APInt constructor:

https://lab.llvm.org/buildbot/#/builders/141/builds/764

Added: 
    

Modified: 
    clang/lib/AST/Interp/Interp.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/Interp.cpp b/clang/lib/AST/Interp/Interp.cpp
index cafe2175f5cc4..0ec77200c3a79 100644
--- a/clang/lib/AST/Interp/Interp.cpp
+++ b/clang/lib/AST/Interp/Interp.cpp
@@ -715,8 +715,8 @@ bool CheckNewDeleteForms(InterpState &S, CodePtr OpPC, bool NewWasArray,
   if (D->isArray()) {
     QualType ElemQT = D->getType()->getPointeeType();
     TypeToDiagnose = S.getCtx().getConstantArrayType(
-        ElemQT, APInt(64, D->getNumElems(), false), nullptr,
-        ArraySizeModifier::Normal, 0);
+        ElemQT, APInt(64, static_cast<uint64_t>(D->getNumElems()), false),
+        nullptr, ArraySizeModifier::Normal, 0);
   } else
     TypeToDiagnose = D->getType()->getPointeeType();
 


        


More information about the cfe-commits mailing list