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

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 19 14:55:43 PDT 2022


any idea what problem MSVC actually had?

On Mon, Sep 19, 2022 at 8:01 AM Simon Pilgrim via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
>
>
> 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);
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list