[llvm] 0a4c946 - Fix MSVC warning "all return expressions must deduce to the same type"

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 19 08:01:08 PDT 2022


Author: Simon Pilgrim
Date: 2022-09-19T16:00:48+01:00
New Revision: 0a4c946abcfaae3601c49a55e29944287f867b7f

URL: https://github.com/llvm/llvm-project/commit/0a4c946abcfaae3601c49a55e29944287f867b7f
DIFF: https://github.com/llvm/llvm-project/commit/0a4c946abcfaae3601c49a55e29944287f867b7f.diff

LOG: Fix MSVC warning "all return expressions must deduce to the same type"

Added: 
    

Modified: 
    llvm/lib/Object/XCOFFObjectFile.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Object/XCOFFObjectFile.cpp b/llvm/lib/Object/XCOFFObjectFile.cpp
index b1f44f1db667..853201283bf6 100644
--- a/llvm/lib/Object/XCOFFObjectFile.cpp
+++ b/llvm/lib/Object/XCOFFObjectFile.cpp
@@ -798,7 +798,7 @@ Expected<DataRefImpl> XCOFFObjectFile::getSectionByNum(int16_t Num) const {
 DataRefImpl
 XCOFFObjectFile::getSectionByType(XCOFF::SectionTypeFlags SectType) const {
   DataRefImpl DRI;
-  auto GetSectionAddr = [&](const auto &Sections) {
+  auto GetSectionAddr = [&](const auto &Sections) -> uintptr_t {
     for (const auto &Sec : Sections)
       if (Sec.getSectionType() == SectType)
         return reinterpret_cast<uintptr_t>(&Sec);


        


More information about the llvm-commits mailing list