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

Fix unique_function constructor selection issues

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.3.1
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Dev Tools 2019-03-25, Dev Tools 2019-04-08, Dev Tools 2019-04-22, Dev Tools 2019-06-03, Dev Tools 2019-07-01

      It appears that code of the following form segfaults due to recursion

      unique_function<void(void)> _fun;
      auto assignFun(unique_function<void(void)> fun){
          _fun = fun;
      }
      

      This appears to be due to the fact that the unique_function ctor resolves to have a non-const lvalue reference parameter of unique_function, which is valid because of the templated ctor.

            Assignee:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            ben.caimano@mongodb.com Benjamin Caimano (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: