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

_makeCoefficientLow in decimal128.h should be static

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.3.1
    • Component/s: Internal Code
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v4.2, v4.0
    • Sprint:
      Security 2019-11-04

      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);

        Attachments

          Activity

            People

            Assignee:
            spencer.jackson Spencer Jackson
            Reporter:
            spencer.jackson Spencer Jackson
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: