<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_cat of nested tuples fails in noexcept specification"
   href="http://llvm.org/bugs/show_bug.cgi?id=19616">19616</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>tuple_cat of nested tuples fails in noexcept specification
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>zerolo@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>Created <span class=""><a href="attachment.cgi?id=12458" name="attach_12458" title="example failing to compile with "clang++ --std=c++11"">attachment 12458</a> <a href="attachment.cgi?id=12458&action=edit" title="example failing to compile with "clang++ --std=c++11"">[details]</a></span>
example failing to compile with "clang++ --std=c++11"

libc++ version is the one included in Xcode 5.1.1

#include <tuple>

std::tuple<std::tuple<const int *> > F()
{
  return std::make_tuple(std::make_tuple(nullptr));
}

int main (int argc, char const *argv[])
{
  auto t1 = F();
  auto works = std::tuple_cat(t1, t2);
  auto breaks = std::tuple_cat(F(), F());
  return 0;
}

The attached example attempts to concatenate two nested tuples. I think it is
correct, but it may not be.
The code files without error with g++ 4.8.1 with libstdc++.

I'm not quite sure what to make of the error messages, it doesn't seem to be
the compiler getting anything wrong.
The rvalue-ness of the arguments seems to be important to triggering the error.

The attached example when compiled with Xcode 5.1.1's clang (Apple LLVM version
5.1 (clang-503.0.40) (based on LLVM 3.4svn))
fails as follows:

<span class="quote">> clang++ --std=c++11 test_tuple.cpp </span >
In file included from test_tuple.cpp:1:
In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/tuple:124:
In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__tuple:16:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/type_traits:2537:47:
error: cannot cast from lvalue of type 'const int *' to rvalue
      reference type 'std::__1::tuple<const int *> &&'; types are not
compatible
    : public integral_constant<bool, noexcept(_Tp(declval<_Args>()...))>
                                              ^~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/type_traits:2549:7:
note: in instantiation of template class
      'std::__1::__is_nothrow_constructible<true, std::__1::tuple<const int *>
&&, const int *>' requested here
    : __is_nothrow_constructible<is_constructible<_Tp, _Args...>::value, _Tp,
_Args...>
      ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/tuple:425:54:
note: in instantiation of template class
      'std::__1::is_nothrow_constructible<std::__1::tuple<const int *> &&,
const int *>' requested here
        __tuple_impl(_Tuple&& __t)
_NOEXCEPT_((__all<is_nothrow_constructible<_Tp, typename tuple_element<_Indx,
                                                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__config:332:34:
note: expanded from macro '_NOEXCEPT_'
#  define _NOEXCEPT_(x) noexcept(x)
                                 ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/type_traits:2537:47:
note: in instantiation of exception specification for
      '__tuple_impl<std::__1::tuple<const int *>, void>' requested here
    : public integral_constant<bool, noexcept(_Tp(declval<_Args>()...))>
                                              ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/type_traits:2549:7:
note: in instantiation of template class
      'std::__1::__is_nothrow_constructible<true,
std::__1::__tuple_impl<std::__1::__tuple_indices<0>, std::__1::tuple<const int
*> &&>, std::__1::tuple<const int *> >' requested here
    : __is_nothrow_constructible<is_constructible<_Tp, _Args...>::value, _Tp,
_Args...>
      ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/tuple:630:41:
note: in instantiation of template class
     
'std::__1::is_nothrow_constructible<std::__1::__tuple_impl<std::__1::__tuple_indices<0>,
std::__1::tuple<const int *> &&>, std::__1::tuple<const int *> >' requested
here
        tuple(_Tuple&& __t) _NOEXCEPT_((is_nothrow_constructible<base,
_Tuple>::value))
                                        ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__config:332:34:
note: expanded from macro '_NOEXCEPT_'
#  define _NOEXCEPT_(x) noexcept(x)
                                 ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/tuple:849:12:
note: in instantiation of exception specification for
      'tuple<std::__1::tuple<const int *>, false>' requested here
    return tuple<_Tp&&...>(_VSTD::forward<_Tp>(__t)...);
           ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/tuple:1047:16:
note: in instantiation of function template specialization
      'std::__1::forward_as_tuple<std::__1::tuple<const int *> >' requested
here
        return forward_as_tuple(_VSTD::forward<_Types>(get<_I0>(__t))...,
               ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/tuple:1058:16:
note: in instantiation of function template specialization
      'std::__1::__tuple_cat<std::__1::tuple<>, std::__1::__tuple_indices<>,
std::__1::__tuple_indices<0>
<span class="quote">>::operator()<std::__1::tuple<std::__1::tuple<const int *> > >' requested here</span >
        return __tuple_cat<
               ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/tuple:1077:12:
note: in instantiation of function template specialization
      'std::__1::__tuple_cat<std::__1::tuple<>, std::__1::__tuple_indices<>,
std::__1::__tuple_indices<> >::operator()<std::__1::tuple<>,
std::__1::tuple<std::__1::tuple<const int *> >>'
      requested here
    return __tuple_cat<tuple<>, __tuple_indices<>,
           ^
test_tuple.cpp:10:22: note: in instantiation of function template
specialization 'std::__1::tuple_cat<std::__1::tuple<>,
std::__1::tuple<std::__1::tuple<const int *> > >' requested here
  auto catted = std::tuple_cat(std::make_tuple(), F());
                     ^
In file included from test_tuple.cpp:1:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/tuple:208:90:
error: no member named 'value' in
      'std::__1::is_nothrow_constructible<std::__1::tuple<const int *> &&,
const int *>'
        explicit __tuple_leaf(_Tp&& __t)
_NOEXCEPT_((is_nothrow_constructible<_Hp, _Tp>::value))
                                                    
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__config:332:34:
note: expanded from macro '_NOEXCEPT_'
#  define _NOEXCEPT_(x) noexcept(x)
                                 ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/tuple:427:15:
note: in instantiation of exception specification for
      '__tuple_leaf<const int *, void>' requested here
            : __tuple_leaf<_Indx, _Tp>(_VSTD::forward<typename
tuple_element<_Indx,
              ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/tuple:631:15:
note: in instantiation of function template specialization
      'std::__1::__tuple_impl<std::__1::__tuple_indices<0>,
std::__1::tuple<const int *> &&>::__tuple_impl<std::__1::tuple<const int *>,
void>' requested here
            : base_(_VSTD::forward<_Tuple>(__t)) {}
              ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/tuple:849:12:
note: in instantiation of function template specialization
      'std::__1::tuple<std::__1::tuple<const int *>
&&>::tuple<std::__1::tuple<const int *>, false>' requested here
    return tuple<_Tp&&...>(_VSTD::forward<_Tp>(__t)...);
           ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/tuple:1047:16:
note: in instantiation of function template specialization
      'std::__1::forward_as_tuple<std::__1::tuple<const int *> >' requested
here
        return forward_as_tuple(_VSTD::forward<_Types>(get<_I0>(__t))...,
               ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/tuple:1058:16:
note: in instantiation of function template specialization
      'std::__1::__tuple_cat<std::__1::tuple<>, std::__1::__tuple_indices<>,
std::__1::__tuple_indices<0>
<span class="quote">>::operator()<std::__1::tuple<std::__1::tuple<const int *> > >' requested here</span >
        return __tuple_cat<
               ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/tuple:1077:12:
note: in instantiation of function template specialization
      'std::__1::__tuple_cat<std::__1::tuple<>, std::__1::__tuple_indices<>,
std::__1::__tuple_indices<> >::operator()<std::__1::tuple<>,
std::__1::tuple<std::__1::tuple<const int *> >>'
      requested here
    return __tuple_cat<tuple<>, __tuple_indices<>,
           ^
test_tuple.cpp:10:22: note: in instantiation of function template
specialization 'std::__1::tuple_cat<std::__1::tuple<>,
std::__1::tuple<std::__1::tuple<const int *> > >' requested here
  auto catted = std::tuple_cat(std::make_tuple(), F());
                     ^
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>