Opened 2 months ago

Closed 2 months ago

#69436 closed defect (fixed)

libjxl @0.10.1: error: constexpr function never produces a constant expression [-Winvalid-constexpr]

Reported by: rmottola (Riccardo) Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version:
Keywords: snowleopard Cc: mascguy (Christopher Nielsen), ctreleaven (Craig Treleaven), dbevans (David B. Evans)
Port: libjxl

Description

Build dies with:

In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_libjxl/libjxl/work/libjxl-0.10.1/lib/jxl/dec_cache.h:26:
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_libjxl/libjxl/work/libjxl-0.10.1/lib/jxl/coeff_order.h:33:42: error: constexpr function never produces a constant expression [-Winvalid-constexpr]
static JXL_MAYBE_UNUSED constexpr size_t CoeffOrderOffset(size_t order,
                                         ^
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_libjxl/libjxl/work/libjxl-0.10.1/lib/jxl/coeff_order.h:35:10: note: non-constexpr function 'operator[]' cannot be used in a constant expression
  return kCoeffOrderOffset[3 * order + c] * kDCTBlockSize;
         ^
/opt/local/libexec/llvm-11/bin/../include/c++/v1/array:204:21: note: declared here
    const_reference operator[](size_type __n) const _NOEXCEPT {
                    ^
[ 20%] Building CXX object lib/CMakeFiles/jxl_extras_core-obj.dir/extras/dec/pnm.cc.o

Build is with clang 11

Change History (7)

comment:1 Changed 2 months ago by rmottola (Riccardo)

GCC confirms the same error.

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_libjxl/libjxl/work/libjxl-0.10.1/lib/jxl/coeff_order.h:35:41: error: call to non-'constexpr' function 'const std::__1::array<_Tp, _Size>::value_type& std::__1::array<_Tp, _Size>::operator[](size_type) const [with _Tp = long unsigned int; long unsigned int _Size = 40; const_reference = const long unsigned int&; size_type = long unsigned int]'
   35 |   return kCoeffOrderOffset[3 * order + c] * kDCTBlockSize;

comment:2 Changed 2 months ago by ryandesign (Ryan Carsten Schmidt)

Keywords: snowleopard added; snow leopard removed
Owner: set to jmroot
Status: newassigned
Summary: libjxl fails on 10.6 Snow Leopard - onstexpr function never produces a constant expression [-Winvalid-constexpr]libjxl @0.10.1: error: constexpr function never produces a constant expression [-Winvalid-constexpr]

comment:3 Changed 2 months ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:4 Changed 2 months ago by mascguy (Christopher Nielsen)

This is occurring for 10.14 and 10.15, as well as 10.6:

https://ports.macports.org/port/libjxl/details/

comment:5 Changed 2 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: ctreleaven added

Has duplicate #69447.

comment:6 Changed 2 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: dbevans added

comment:7 Changed 2 months ago by jmroot (Joshua Root)

Resolution: fixed
Status: assignedclosed

In 28ef5c203a92b91cd08f07c8b0ba5528da47cedf/macports-ports (master):

libjxl: update to 0.10.2

Closes: #69436

Note: See TracTickets for help on using tickets.