Author: Alexandre Ganea
Date: 2026-03-22T19:48:38-04:00
New Revision: 7482655a6b57864cd8b94949a6eb0b2fa5621f4d

URL: 
https://github.com/llvm/llvm-project/commit/7482655a6b57864cd8b94949a6eb0b2fa5621f4d
DIFF: 
https://github.com/llvm/llvm-project/commit/7482655a6b57864cd8b94949a6eb0b2fa5621f4d.diff

LOG: [clang] On Windows, silence warning when building with MSVC (#187937)

This fixes:
```
[2124/7029] Building CXX object 
tools\clang\lib\AST\CMakeFiles\obj.clangAST.dir\TemplateBase.cpp.obj
C:\git\llvm-project\clang\lib\AST\TemplateBase.cpp(753): warning C4312: 
'reinterpret_cast': conversion from 'clang::SourceLocation::UIntTy' to 
'clang::TemplateArgumentLocInfo::LocOrPointer' of greater size
```

Added: 
    

Modified: 
    clang/lib/AST/TemplateBase.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/TemplateBase.cpp b/clang/lib/AST/TemplateBase.cpp
index f76c2e336dc86..a5e0dde45364c 100644
--- a/clang/lib/AST/TemplateBase.cpp
+++ b/clang/lib/AST/TemplateBase.cpp
@@ -750,8 +750,8 @@ clang::TemplateArgumentLocInfo::TemplateArgumentLocInfo(
 clang::TemplateArgumentLocInfo::TemplateArgumentLocInfo(
     ASTContext &Ctx, SourceLocation TrivialLoc) {
   if constexpr (EmbedLocInPointer)
-    Pointer = reinterpret_cast<LocOrPointer>((TrivialLoc.getRawEncoding() + 1u)
-                                             << LowBitsRequired);
+    Pointer = reinterpret_cast<LocOrPointer>(static_cast<uintptr_t>(
+        (TrivialLoc.getRawEncoding() + 1u) << LowBitsRequired));
   else
     Pointer = new (Ctx) SourceLocation(TrivialLoc);
 }


        
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to