Bug 59901 - internal compiler error: in retrieve_specialization cp/pt.c:1012
Summary: internal compiler error: in retrieve_specialization cp/pt.c:1012
Status: RESOLVED DUPLICATE of bug 53492
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.7.3
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-22 03:05 UTC by burrows
Modified: 2014-01-22 11:06 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
preprocessed source (79.31 KB, text/x-csrc)
2014-01-22 03:05 UTC, burrows
Details

Note You need to log in before you can comment on or make changes to this bug.
Description burrows 2014-01-22 03:05:24 UTC
Created attachment 31914 [details]
preprocessed source

Code and error below; I've also attached the preprocessed source. The problem also seems to exist in 4.8

#include <tuple>
#include <iostream>

// designates a field to be serialized
template <typename Name, typename Type>
class MemberPair {
public:
    typedef Type type;
    typedef Name name;
};

template <typename... All>
class A {};

template <typename Base, typename Head, typename... Tail>
class A<Base, Head, Tail...> : A<Base, Tail...> {
public:
    template <typename NameAttemptHead, typename... NameAttemptTail>
    using Type =
        typename
            std::tuple<typename
                std::enable_if<std::is_same<NameAttemptHead,
                                            typename Head::name>::value,
                               typename Head::type>::type,
                typename A<Base, Tail...>::template Type<NameAttemptTail...> >;

};

template <typename Base>
class A<Base> {
public:
    template <typename... Empty>
    using Type = std::tuple<>;
};

namespace F {
    struct x;
    struct y;
    struct z;
}

class D : public A<D, MemberPair<F::x, int>,
                      MemberPair<F::y, int>,
                      MemberPair<F::z, std::string> > {

};

int
main()
{
    // D dee;
    // static_cast< A<D, MemberPair<F::y>, MemberPair<F::z> &>(dee);
    return 0;
}

// eof

$ g++-4.7 -std=c++0x -pedantic -Wall gettype.cpp -o gettype -g
gettype.cpp: In instantiation of ‘class A<D, MemberPair<F::z, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >’:
gettype.cpp:16:7:   recursively required from ‘class A<D, MemberPair<F::y, int>, MemberPair<F::z, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >’
gettype.cpp:16:7:   required from ‘class A<D, MemberPair<F::x, int>, MemberPair<F::y, int>, MemberPair<F::z, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >’
gettype.cpp:41:18:   required from here
gettype.cpp:32:30: internal compiler error: in retrieve_specialization, at cp/pt.c:1012
Please submit a full bug report,
Comment 1 Marek Polacek 2014-01-22 11:06:16 UTC
Dup.

*** This bug has been marked as a duplicate of bug 53492 ***