<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:dblaikie@gmail.com" title="David Blaikie <dblaikie@gmail.com>"> <span class="fn">David Blaikie</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - std::map::emplace calls wrong value type constructor"
   href="https://llvm.org/bugs/show_bug.cgi?id=24860">bug 24860</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
                
           </td>
           <td>dblaikie@gmail.com
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>INVALID
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - std::map::emplace calls wrong value type constructor"
   href="https://llvm.org/bugs/show_bug.cgi?id=24860#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - std::map::emplace calls wrong value type constructor"
   href="https://llvm.org/bugs/show_bug.cgi?id=24860">bug 24860</a>
              from <span class="vcard"><a class="email" href="mailto:dblaikie@gmail.com" title="David Blaikie <dblaikie@gmail.com>"> <span class="fn">David Blaikie</span></a>
</span></b>
        <pre>This seems to be working as intended & doesn't seem to be related to std::map.

Your emplace call is roughly equivalent to this construction of a std::pair:

std::pair<int, Thing> p(0, std::string("hello"));

which exhibits the same compilation error as your std::map::emplace call.

The reason is that std::is_convertible<std::string, Thing>::value is false.
This is because Thing is not copy or move constructible, which is curious, but
technically the way that std::is_convertible is defined:

"the predicate condition for a template specialization is_convertible<From, To>
shall be satisfied if and only if the return expression in the following code
would be well-formed, including any implicit conversions to the return type of
the function:

  To test() {
    return create<From>();
  }"</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>