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

Compilation error with LWG-2774

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Fully Compatible
    • ALL
    • Hide

      Build the server and run tests with a C++ implementation that implements the resolution of LWG-2774. I'm not certain if any released compiler yet does so: recent GCC may, MSVC won't ship until Visual Studio 2022 version 17.2 preview 2. If you're especially motivated, you could install the most recent VS preview, build https://GitHub.com/microsoft/STL, and build a server with those development STL bits.

      In any case, there's an open PR at https://github.com/mongodb/mongo/pull/1437 with the two-line backwards-compatible fix.

      Show
      Build the server and run tests with a C++ implementation that implements the resolution of LWG-2774. I'm not certain if any released compiler yet does so: recent GCC may, MSVC won't ship until Visual Studio 2022 version 17.2 preview 2. If you're especially motivated, you could install the most recent VS preview, build  https://GitHub.com/microsoft/STL , and build a server with those development STL bits. In any case, there's an open PR at https://github.com/mongodb/mongo/pull/1437  with the two-line backwards-compatible fix.
    • Service Arch 2022-03-07, Service Arch 2022-03-21, Service Arch 2022-04-04, Service Arch 2022-04-18

       

      WG21 recently approved a change to std::function in the C++ standard library as the resolution of LWG issue 2774. As a result, the previous constructor signature:

      template <class F>
      function(F fn);

      was replaced by:

       

       

      template <class F>
      function(F&& fn);

       

      With the change implemented, that constructor becomes a better match for non-const unique_function arguments than unique_function's const-qualified deleted conversion operator template to std::function. As a result, std::is_convertible_v<unique_function<T>, std::function<T>> changes from false to true when Standard Libraries implement LWG-2774. MSVC recently implemented this LWG issue in microsoft/STL#2098 and noticed the unique_function test failing as a result.

            Assignee:
            blake.oler@mongodb.com Blake Oler
            Reporter:
            casey@carter.net Casey Carter
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: