<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 --- - tuple: non-default constructible tuple hard failure"
   href="http://llvm.org/bugs/show_bug.cgi?id=21157">21157</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>tuple: non-default constructible tuple hard failure
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.4
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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>ldionne.2@gmail.com
          </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>When using the is_default_constructible trait with a tuple that has non
default-constructible elements, a hard compilation error happens instead
of the trait returning false. I'm pretty sure this should not happen, but
I'm not sure why it does even after looking at the code for a while. I think
it has to do with the default constructor of std::tuple being defined
regardless of the default-constructibility of its elements.

Test case
------------------------------------------------------------------------------
#include <tuple>
#include <type_traits>


struct nodefault {
    nodefault() = delete;
};

static_assert(!std::is_default_constructible<
    std::tuple<nodefault>
<span class="quote">>::value, "");</span >

int main() { }
------------------------------------------------------------------------------

Compiler output:
------------------------------------------------------------------------------
› ~/code/llvm/release/bin/clang++ -ftemplate-backtrace-limit=0 -std=c++1y
-o/dev/null ~/desktop/bugreports/tuple_default/tc1.cpp
In file included from
/Users/ldionne/desktop/bugreports/tuple_default/tc1.cpp:3:
/Users/ldionne/code/llvm/projects/libcxx/include/tuple:307:49: error: call to
deleted constructor of 'nodefault'
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR __tuple_leaf()
                                                ^
/Users/ldionne/code/llvm/projects/libcxx/include/tuple:402:23: note: in
instantiation of member function 'std::__1::__tuple_leaf<0, nodefault,
true>::__tuple_leaf' requested here
    _LIBCPP_CONSTEXPR __tuple_impl()
                      ^
/Users/ldionne/code/llvm/projects/libcxx/include/tuple:516:23: note: in
instantiation of member function
'std::__1::__tuple_impl<std::__1::__tuple_indices<0>, nodefault>::__tuple_impl'
requested here
    _LIBCPP_CONSTEXPR tuple()
                      ^
/Users/ldionne/code/llvm/projects/libcxx/include/type_traits:2445:31: note: in
instantiation of member function 'std::__1::tuple<nodefault>::tuple' requested
here
    : integral_constant<bool, __is_constructible(_Tp, _Args...)>
                              ^
/Users/ldionne/code/llvm/projects/libcxx/include/type_traits:2637:14: note: in
instantiation of template class
'std::__1::is_constructible<std::__1::tuple<nodefault>>' requested here
    : public is_constructible<_Tp>
             ^
/Users/ldionne/desktop/bugreports/tuple_default/tc1.cpp:11:21: note: in
instantiation of template class
'std::__1::is_default_constructible<std::__1::tuple<nodefault> >' requested
here
static_assert(!std::is_default_constructible<
                    ^
/Users/ldionne/desktop/bugreports/tuple_default/tc1.cpp:8:5: note: 'nodefault'
has been explicitly marked deleted here
    nodefault() = delete;
    ^
/Users/ldionne/desktop/bugreports/tuple_default/tc1.cpp:11:1: error:
static_assert failed ""
static_assert(!std::is_default_constructible<
^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
------------------------------------------------------------------------------</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>