<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - std::is_constructible for scalar types only allows implicit conversion"
   href="http://llvm.org/bugs/show_bug.cgi?id=21574">21574</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>std::is_constructible for scalar types only allows implicit conversion
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libc++
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>sebastian@theophil.net
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu, mclow.lists@gmail.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=13349" name="attach_13349" title="Reproduction of bug">attachment 13349</a> <a href="attachment.cgi?id=13349&action=edit" title="Reproduction of bug">[details]</a></span>
Reproduction of bug

When T is a scalar type, the library implementation of std::is_constructible<T,
Arg> returns true iff Arg is implicitly convertible to T. 

However, the C++11 standard section  20.9.4.3 says: 

<span class="quote">> Given the following function prototype:

> template <class T>
> typename add_rvalue_reference<T>::type create();

> the predicate condition for a template specialization is_constructible<T, Args...> shall be satisfied if and only if the following variable definition would be well-formed for some invented variable t:

> T t(create<Args>()...);</span >

To reproduce, compile attached file with "c++ -std=c++11 multiprecision.cpp"
using clang version <= 3.4 or clang shipping with Xcode 6.1

The static_assert fails but the explicit construction does not. 

I've tried clang 3.5 at <a href="http://melpon.org/wandbox">http://melpon.org/wandbox</a> and the static_assert does
not fail anymore. BUT, from looking at
<a href="http://llvm.org/svn/llvm-project/libcxx/trunk/include/type_traits">http://llvm.org/svn/llvm-project/libcxx/trunk/include/type_traits</a> it seems that
libcxx now checks for the compiler feature "is_constructible" and uses that if
available, which apparently produces the expected result. 

The manual implementation below still contains the same error from what I can
see.</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>