Build failure in overflow_arithmetic.h: constexpr function never produces a constant expression

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.2.4, 4.3.4
    • Affects Version/s: 4.2.3
    • Component/s: Build
    • None
    • Fully Compatible
    • ALL
    • v4.2
      • Install MacPorts on your High Sierra based (with all available Apple updates) Mac.
      • Run sudo port install mongodb
    • Dev Platform 2020-02-10
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The attempt to build MongoDB 4.2.3 on macOS 10.14 (High Sierra) fails:

      :info:build src/mongo/platform/overflow_arithmetic.h:97:16: error: constexpr function never produces a constant expression [-Winvalid-constexpr]
      :info:build constexpr bool mongoSignedMultiplyOverflow64(long lhs, long rhs, long* product) {
      :info:build ^
      :info:build src/mongo/platform/overflow_arithmetic.h:98:12: note: subexpression not valid in a constant expression
      :info:build return __builtin_mul_overflow(lhs, rhs, product);
      :info:build ^
      

      Please also see attached build log and MacPorts ticket 60032

              Assignee:
              Andrew Morrow (Inactive)
              Reporter:
              Ralph Seichter
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: