[SERVER-44059] _makeCoefficientLow in decimal128.h should be static Created: 17/Oct/19  Updated: 29/Oct/23  Resolved: 24/Oct/19

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 4.3.1

Type: Bug Priority: Major - P3
Reporter: Spencer Jackson Assignee: Spencer Jackson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.2, v4.0
Sprint: Security 2019-11-04
Participants:

 Description   

Clang 9 emits the following error:

src/mongo/platform/decimal128_test.cpp:117:26: error: constexpr variable 'expected' must be initialized by a constant expression
constexpr Decimal128 expected(10);
^~~~~~~~~~~~
src/mongo/platform/decimal128.h:179:55: note: member call on object outside its lifetime is not allowed in a constant expression
: Decimal128(v < 0 ? 1 : 0, kExponentBias, 0, _makeCoefficientLow(v)) {}
^
src/mongo/platform/decimal128_test.cpp:117:26: note: in call to 'Decimal128(10)'
constexpr Decimal128 expected(10);



 Comments   
Comment by Githook User [ 24/Oct/19 ]

Author:

{'username': 'spencerjackson', 'email': 'spencer.jackson@mongodb.com', 'name': 'Spencer Jackson'}

Message: SERVER-44059 Make _makeCoefficientLow in decimal128.h static
Branch: master
https://github.com/mongodb/mongo/commit/2b6f5ce734f834ca73d0fbe9da162c0ab43a5345

Generated at Thu Feb 08 05:04:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.