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

_makeCoefficientLow in decimal128.h should be static

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 4.3.1
    • None
    • Internal Code
    • None
    • Fully Compatible
    • ALL
    • v4.2, v4.0
    • 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

            spencer.jackson@mongodb.com Spencer Jackson
            spencer.jackson@mongodb.com Spencer Jackson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: