tuple_cat not working? (Linux icpc (ICC) 13.1.2 20130514 w/ libstdc++4.7.0)

tuple_cat not working? (Linux icpc (ICC) 13.1.2 20130514 w/ libstdc++4.7.0)

I'm having trouble getting tuple_cat to work with the above release of the Intel C++ Compiler.

The rather simple example below compiles fine with g++4.7.0 and clang3.1.
Similarly, the example on http://en.cppreference.com/w/cpp/utility/tuple/tuple_cat fails as well.

I did not see anything in Intel's supported C++11 features list that should prevent this from working.

Is this a known problem?

--------------
#include <tuple>

template <typename arg>
void test(arg &&i)
{
auto hello = std::tuple_cat(std::make_tuple(), std::forward_as_tuple(i));
}

int main(int argc, char const *argv[])
{
double *p = nullptr;
int i = 37;
auto hello1 = std::tuple_cat(std::make_tuple(), std::make_tuple(p));
auto hello2 = std::tuple_cat(std::make_tuple(1), std::make_tuple(2));
test(i);
return 0;
}

Thanks,
Daniel.

AttachmentSize
Downloadtext/x-c++src simple.cpp380 bytes
4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

 

Yes, this is a known bug and is being tracked in our bug tracking database as DPD200244728.

Sorry for the inconvenience, we will fix it as soon as possible.

Judy

This bug is still present in icpc version 14.0.0 (gcc version 4.7.0 compatibility) (but also occurs with the stdlibc++ from gcc 4.8.1):

icpc -std=c++11 t.cpp
/home_as/applications/gnu/gcc/4.7.0/include/c++/4.7.0/tuple(1003): error: expected a ")"
_S_do(_Tp&& __tp, _Tpls&&... __tps, _Us&&... __us)
^
detected during:
instantiation of class "std::__tuple_concater<_Ret, std::_Index_tuple<_Is...>, _Tp, _Tpls...> [with _Ret=std::tuple<double *>, _Is=<0UL>, _Tp=std::tuple<double *>, _Tpls=<>]" at line 1007
instantiation of "_Ret std::__tuple_concater<_Ret, std::_Index_tuple<_Is...>, _Tp, _Tpls...>::_S_do(_Tp &&, _Tpls &&..., _Us &&...) [with _Ret=std::tuple<double *>, _Is=<>, _Tp=std::tuple<>, _Tpls=<std::tuple<double *>>, _Us=<>]" at line 1033
instantiation of "auto std::tuple_cat(_Tpls &&...)->std::__tuple_cat_result<_Tpls...>::__type [with _Tpls=<std::tuple<>, std::tuple<double *>>, <unnamed>=void]" at line 13 of "simple.cpp"

/home_as/applications/gnu/gcc/4.7.0/include/c++/4.7.0/tuple(1007): error: no instance of function template "std::__tuple_concater<_Ret, std::_Index_tuple<_Is...>, _Tp, _Tpls...>::_S_do [with _Ret=std::tuple<int, int>, _Is=<0UL>, _Tp=std::tuple<int>, _Tpls=<>]" matches the argument list
argument types are: (std::tuple<int>, int)
return __next::_S_do(std::forward<_Tpls>(__tps)...,
^
detected during:
instantiation of "_Ret std::__tuple_concater<_Ret, std::_Index_tuple<_Is...>, _Tp, _Tpls...>::_S_do(_Tp &&, _Tpls &&..., _Us &&...) [with _Ret=std::tuple<int, int>, _Is=<0UL>, _Tp=std::tuple<int>, _Tpls=<std::tuple<int>>, _Us=<>]" at line 1033
instantiation of "auto std::tuple_cat(_Tpls &&...)->std::__tuple_cat_result<_Tpls...>::__type [with _Tpls=<std::tuple<int>, std::tuple<int>>, <unnamed>=void]" at line 14 of "t.cpp"

compilation aborted for simple.cpp (code 2)

I think you probably know about this already, but to be easier for the others, this tuple issue has been fixed some time back. The fix is available in 14.0 (update1 or later) and 15.0.

Jennifer

Leave a Comment

Please sign in to add a comment. Not a member? Join today