C++ constexpr woes while updating firefox

From: Christoph Moench-Tegeder <cmt_at_burggraben.net>
Date: Mon, 11 May 2026 18:36:04 UTC
Hi,

I'm stumbling on a problem (propably) related to C++ constexpr while
updating firefox (current beta).

The frame of reference here is FreeBSD 14.4-STABLE amd64, with llvm19
from ports (default) (but switching to llvm21 makes no difference).

The relevant build failure seems start with this:

In file included from /wrkdirs/usr/ports/www/firefox/work/firefox-151.0/js/src/builtin/intl/SharedIntlData.h:21:
/wrkdirs/usr/ports/www/firefox/work/firefox-151.0/js/src/util/LanguageId.h:234:66: error: constexpr function's return type 'mozilla::Maybe<std::pair<LanguageId, size_t>>' (aka 'Maybe<pair<js::LanguageId, unsigned long>>') is not a literal type
  234 |   static constexpr mozilla::Maybe<std::pair<LanguageId, size_t>> from(
      |                                                                  ^
/wrkdirs/usr/ports/www/firefox/work/.build/dist/include/mozilla/Maybe.h:367:7: note: 'Maybe<std::pair<js::LanguageId, unsigned long>>' is not literal because it has base class 'detail::MaybeStorage<std::pair<js::LanguageId, unsigned long>>' of non-literal type
  367 |     : private detail::MaybeStorage<T>,
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The code in question is here (the build systems does some shuffling):
- Maybe.h: https://github.com/mozilla-firefox/firefox/blob/beta/mfbt/Maybe.h
  Especially detail::MaybeStorage is defined starting here:
  https://github.com/mozilla-firefox/firefox/blob/beta/mfbt/Maybe.h#L238
- LanguageId.h: https://github.com/mozilla-firefox/firefox/blob/beta/js/src/util/LanguageId.h

As far as I can see, the whole class setup is independent of OS and
compiler - that is, the other (major) platforms have no problem compiling
this.
I feel like I'm missing some major thing here - I've exhausted my sparse
C++ knowledge and I'm now officially out of my depths.

Has anyone a hint how to proceed here?
I can provide full logs, but the output is about 15MB and rather
uneventful (I believe). I'll ask the Mozilla people in parallel; but this
seems to be rather specific...

Regards,
Christoph

-- 
Spare Space