This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/52109] New: Apparently endless recursive instantiation


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52109

             Bug #: 52109
           Summary: Apparently endless recursive instantiation
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: vegard.nossum@gmail.com


#include <tuple>
#include <type_traits>

template<typename... Args>
void x(Args... args) {
        x(std::tuple<Args...>(args...));
}

void y()
{
        x();
}

This seems to put the compiler into an endless loop, with errors looking like
this:

In file included from test3.cc:1:0:
/usr/include/c++/4.6/tuple: In member function âstd::_Tuple_impl<_Idx, _Head,
_Tail ...>::_Inherited& std::_Tuple_impl<_Idx, _Head, _Tail ...>::_M_tail()
[with long unsigned int _Idx = 0ul, _Head = std::tuple<std::tuple<> >, _Tail =
{}, std::_Tuple_impl<_Idx, _Head, _Tail ...>::_Inherited =
std::_Tuple_impl<1ul>]â:
/usr/include/c++/4.6/tuple:174:43:   instantiated from âstd::_Tuple_impl<_Idx,
_Head, _Tail ...>::_Tuple_impl(std::_Tuple_impl<_Idx, _Head, _Tail ...>&&)
[with long unsigned int _Idx = 0ul, _Head = std::tuple<std::tuple<> >, _Tail =
{}, std::_Tuple_impl<_Idx, _Head, _Tail ...> = std::_Tuple_impl<0ul,
std::tuple<std::tuple<> > >]â
test3.cc:6:2:   recursively instantiated from âvoid x(Args ...) [with Args =
{std::tuple<>}]â
test3.cc:6:2:   instantiated from âvoid x(Args ...) [with Args = {}]â
test3.cc:11:4:   instantiated from here
/usr/include/c++/4.6/tuple:154:51: error: âstd::_Tuple_impl<1ul>â is an
ambiguous base of âstd::_Tuple_impl<0ul, std::tuple<std::tuple<> > >â
/usr/include/c++/4.6/tuple: In member function âstd::_Tuple_impl<_Idx, _Head,
_Tail ...>::_Inherited& std::_Tuple_impl<_Idx, _Head, _Tail ...>::_M_tail()
[with long unsigned int _Idx = 0ul, _Head = std::tuple<std::tuple<std::tuple<>
> >, _Tail = {}, std::_Tuple_impl<_Idx, _Head, _Tail ...>::_Inherited =
std::_Tuple_impl<1ul>]â:
/usr/include/c++/4.6/tuple:174:43:   instantiated from âstd::_Tuple_impl<_Idx,
_Head, _Tail ...>::_Tuple_impl(std::_Tuple_impl<_Idx, _Head, _Tail ...>&&)
[with long unsigned int _Idx = 0ul, _Head = std::tuple<std::tuple<std::tuple<>
> >, _Tail = {}, std::_Tuple_impl<_Idx, _Head, _Tail ...> =
std::_Tuple_impl<0ul, std::tuple<std::tuple<std::tuple<> > > >]â
test3.cc:6:2:   recursively instantiated from âvoid x(Args ...) [with Args =
{std::tuple<>}]â
test3.cc:6:2:   instantiated from âvoid x(Args ...) [with Args = {}]â
test3.cc:11:4:   instantiated from here
/usr/include/c++/4.6/tuple:154:51: error: âstd::_Tuple_impl<1ul>â is an
ambiguous base of âstd::_Tuple_impl<0ul, std::tuple<std::tuple<std::tuple<> > >
>â
/usr/include/c++/4.6/tuple: In member function âstd::_Tuple_impl<_Idx, _Head,
_Tail ...>::_Inherited& std::_Tuple_impl<_Idx, _Head, _Tail ...>::_M_tail()
[with long unsigned int _Idx = 0ul, _Head =
std::tuple<std::tuple<std::tuple<std::tuple<> > > >, _Tail = {},
std::_Tuple_impl<_Idx, _Head, _Tail ...>::_Inherited = std::_Tuple_impl<1ul>]â:
/usr/include/c++/4.6/tuple:174:43:   instantiated from âstd::_Tuple_impl<_Idx,
_Head, _Tail ...>::_Tuple_impl(std::_Tuple_impl<_Idx, _Head, _Tail ...>&&)
[with long unsigned int _Idx = 0ul, _Head =
std::tuple<std::tuple<std::tuple<std::tuple<> > > >, _Tail = {},
std::_Tuple_impl<_Idx, _Head, _Tail ...> = std::_Tuple_impl<0ul,
std::tuple<std::tuple<std::tuple<std::tuple<> > > > >]â
test3.cc:6:2:   recursively instantiated from âvoid x(Args ...) [with Args =
{std::tuple<>}]â
test3.cc:6:2:   instantiated from âvoid x(Args ...) [with Args = {}]â
test3.cc:11:4:   instantiated from here
[...]

(Or is this unfixable as a manifestation of the halting problem?)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]