Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-45922

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

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 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

      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@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            mongodb.com@seichter.de Ralph Seichter
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: