https://llvm.org/bugs/show_bug.cgi?id=24860

            Bug ID: 24860
           Summary: std::map::emplace calls wrong value type constructor
           Product: libc++
           Version: 3.6
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: ryancer...@gmail.com
                CC: llvm-bugs@lists.llvm.org, mclow.li...@gmail.com
    Classification: Unclassified

#include <string>
#include <map>

class Thing {
public:
  Thing(const std::string &a) : mS(a) {};

private:
  Thing(const Thing&) = delete;
  Thing(Thing &&) = delete;

  std::string mS;
};    

int main(int argc, char *argv[]) {
  std::map<int, Thing> m;
  m.emplace(0, std::string("hello"));
}



This tries to call the deleted copy constructor instead of calling
Thing::Thing(const std::string &) to emplace the object in the std::map.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to