[Bug 276154] devel/llvm10: fix build with clang 18

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 06 Jan 2024 17:27:53 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=276154

            Bug ID: 276154
           Summary: devel/llvm10: fix build with clang 18
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: brooks@FreeBSD.org
          Reporter: dim@FreeBSD.org
          Assignee: brooks@FreeBSD.org
             Flags: maintainer-feedback?(brooks@FreeBSD.org)

Clang 18 as of 2024-01-06 has some trouble with a construct in llvm 10's
Optional.h header, resulting in errors building devel/llvm10:

  In file included from
/wrkdirs/usr/ports/devel/llvm10/work/llvm-10.0.1.src/lib/Support/ARMTargetParser.cpp:14:
  In file included from
/wrkdirs/usr/ports/devel/llvm10/work/llvm-10.0.1.src/include/llvm/Support/ARMTargetParser.h:17:
  In file included from
/wrkdirs/usr/ports/devel/llvm10/work/llvm-10.0.1.src/include/llvm/ADT/StringRef.h:12:
  In file included from
/wrkdirs/usr/ports/devel/llvm10/work/llvm-10.0.1.src/include/llvm/ADT/STLExtras.h:19:
 
/wrkdirs/usr/ports/devel/llvm10/work/llvm-10.0.1.src/include/llvm/ADT/Optional.h:289:8:
error: cannot overload a member function with ref-qualifier '&&' with a member
function without a ref-qualifier
    289 |   auto map(const Function &F) &&
        |        ^
 
/wrkdirs/usr/ports/devel/llvm10/work/llvm-10.0.1.src/include/llvm/ADT/Optional.h:272:8:
note: previous declaration is here
    272 |   auto map(const Function &F) const
        |        ^

A similar issue has been reported to llvm upstream, but it is not clear
yet whether this is a clang regression or an intended behavior. In the
mean time, we can apply
https://github.com/llvm/llvm-project/commit/90cfbb81674ec to make the
port build with clang 18, as a workaround.

-- 
You are receiving this mail because:
You are the assignee for the bug.