[MacPorts] #60032: mongodb @4.2.3: error: constexpr function never produces a constant expression (was: MongoDB 4.2.3 fails to build on High Sierra)

MacPorts noreply at macports.org
Wed Feb 5 17:10:11 UTC 2020


#60032: mongodb @4.2.3: error: constexpr function never produces a constant
expression
------------------------+------------------------
  Reporter:  rseichter  |      Owner:  ryandesign
      Type:  defect     |     Status:  closed
  Priority:  Normal     |  Milestone:
 Component:  ports      |    Version:  2.6.2
Resolution:  duplicate  |   Keywords:
      Port:  mongodb    |
------------------------+------------------------
Changes (by ryandesign):

 * status:  assigned => closed
 * cc: acmorrow (added)
 * resolution:   => duplicate


Comment:

 The fact that we need to update the MacPorts copy of the Apple linker is
 #57587.

 But I don't see what all this talk of a linker has to do with the errors
 shown in the [attachment:main.log first main.log] attached here:

 {{{
 :info:build In file included from
 src/mongo/s/request_types/set_shard_version_request.cpp:32:
 :info:build In file included from
 src/mongo/s/request_types/set_shard_version_request.h:35:
 :info:build In file included from src/mongo/client/connection_string.h:40:
 :info:build In file included from src/mongo/platform/mutex.h:38:
 :info:build In file included from src/mongo/util/duration.h:38:
 :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            ^
 :info:build src/mongo/platform/overflow_arithmetic.h:101:16: error:
 constexpr function never produces a constant expression [-Winvalid-
 constexpr]
 :info:build constexpr bool mongoSignedMultiplyOverflow64(long long lhs,
 long long rhs, long long* product) {
 :info:build                ^
 :info:build src/mongo/platform/overflow_arithmetic.h:102:12: note:
 subexpression not valid in a constant expression
 :info:build     return __builtin_mul_overflow(lhs, rhs, product);
 :info:build            ^
 :info:build src/mongo/platform/overflow_arithmetic.h:105:16: error:
 constexpr function never produces a constant expression [-Winvalid-
 constexpr]
 :info:build constexpr bool mongoUnsignedMultiplyOverflow64(unsigned long
 lhs,
 :info:build                ^
 :info:build src/mongo/platform/overflow_arithmetic.h:108:12: note:
 subexpression not valid in a constant expression
 :info:build     return __builtin_mul_overflow(lhs, rhs, product);
 :info:build            ^
 :info:build src/mongo/platform/overflow_arithmetic.h:111:16: error:
 constexpr function never produces a constant expression [-Winvalid-
 constexpr]
 :info:build constexpr bool mongoUnsignedMultiplyOverflow64(unsigned long
 long lhs,
 :info:build                ^
 :info:build src/mongo/platform/overflow_arithmetic.h:114:12: note:
 subexpression not valid in a constant expression
 :info:build     return __builtin_mul_overflow(lhs, rhs, product);
 :info:build            ^
 :info:build src/mongo/platform/overflow_arithmetic.h:117:16: error:
 constexpr function never produces a constant expression [-Winvalid-
 constexpr]
 :info:build constexpr bool mongoSignedAddOverflow64(long lhs, long rhs,
 long* sum) {
 :info:build                ^
 :info:build src/mongo/platform/overflow_arithmetic.h:118:12: note:
 subexpression not valid in a constant expression
 :info:build     return __builtin_add_overflow(lhs, rhs, sum);
 :info:build            ^
 :info:build src/mongo/platform/overflow_arithmetic.h:121:16: error:
 constexpr function never produces a constant expression [-Winvalid-
 constexpr]
 :info:build constexpr bool mongoSignedAddOverflow64(long long lhs, long
 long rhs, long long* sum) {
 :info:build                ^
 :info:build src/mongo/platform/overflow_arithmetic.h:122:12: note:
 subexpression not valid in a constant expression
 :info:build     return __builtin_add_overflow(lhs, rhs, sum);
 :info:build            ^
 :info:build src/mongo/platform/overflow_arithmetic.h:125:16: error:
 constexpr function never produces a constant expression [-Winvalid-
 constexpr]
 :info:build constexpr bool mongoUnsignedAddOverflow64(unsigned long lhs,
 :info:build                ^
 :info:build src/mongo/platform/overflow_arithmetic.h:128:12: note:
 subexpression not valid in a constant expression
 :info:build     return __builtin_add_overflow(lhs, rhs, sum);
 :info:build            ^
 :info:build src/mongo/platform/overflow_arithmetic.h:131:16: error:
 constexpr function never produces a constant expression [-Winvalid-
 constexpr]
 :info:build constexpr bool mongoUnsignedAddOverflow64(unsigned long long
 lhs,
 :info:build                ^
 :info:build src/mongo/platform/overflow_arithmetic.h:134:12: note:
 subexpression not valid in a constant expression
 :info:build     return __builtin_add_overflow(lhs, rhs, sum);
 :info:build            ^
 :info:build src/mongo/platform/overflow_arithmetic.h:137:16: error:
 constexpr function never produces a constant expression [-Winvalid-
 constexpr]
 :info:build constexpr bool mongoSignedSubtractOverflow64(long lhs, long
 rhs, long* difference) {
 :info:build                ^
 :info:build src/mongo/platform/overflow_arithmetic.h:138:12: note:
 subexpression not valid in a constant expression
 :info:build     return __builtin_sub_overflow(lhs, rhs, difference);
 :info:build            ^
 :info:build src/mongo/platform/overflow_arithmetic.h:141:16: error:
 constexpr function never produces a constant expression [-Winvalid-
 constexpr]
 :info:build constexpr bool mongoSignedSubtractOverflow64(long long lhs,
 long long rhs, long long* difference) {
 :info:build                ^
 :info:build src/mongo/platform/overflow_arithmetic.h:142:12: note:
 subexpression not valid in a constant expression
 :info:build     return __builtin_sub_overflow(lhs, rhs, difference);
 :info:build            ^
 :info:build src/mongo/platform/overflow_arithmetic.h:145:16: error:
 constexpr function never produces a constant expression [-Winvalid-
 constexpr]
 :info:build constexpr bool mongoUnsignedSubtractOverflow64(unsigned long
 lhs,
 :info:build                ^
 :info:build src/mongo/platform/overflow_arithmetic.h:148:12: note:
 subexpression not valid in a constant expression
 :info:build     return __builtin_sub_overflow(lhs, rhs, sum);
 :info:build            ^
 :info:build src/mongo/platform/overflow_arithmetic.h:151:16: error:
 constexpr function never produces a constant expression [-Winvalid-
 constexpr]
 :info:build constexpr bool mongoUnsignedSubtractOverflow64(unsigned long
 long lhs,
 :info:build                ^
 :info:build src/mongo/platform/overflow_arithmetic.h:154:12: note:
 subexpression not valid in a constant expression
 :info:build     return __builtin_sub_overflow(lhs, rhs, sum);
 :info:build            ^
 }}}

 The linker errors only occurred due to Ken's suggestion to use a newer
 MacPorts clang, which IMHO should not be necessary—unless it it felt that
 these compiler error messages are in fact a bug in the Xcode 10 version of
 the compiler which the developers of mongodb do not wish to work around,
 in which case sure we can blacklist the affected Xcode compilers.

-- 
Ticket URL: <https://trac.macports.org/ticket/60032#comment:23>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list