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

             Bug #: 55220
           Summary: [c++11] Internal error when doing partial template
                    specialization on variadic template
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: alex.ir...@gmail.com


GCC is reporting internal error when compiling the following well-formed (to my
belief) code:

#include <iostream>

template <typename ...> struct something_like_tuple 
{

};

template <typename, typename> struct is_last
{
    static const bool value = false;
};

template <typename T, template <typename ...> class Tuple, typename ... Head> 
struct is_last<T, Tuple<Head ..., T>>
{
    static const bool value = true;
};

int main(int argc, char* argv[])
{
    typedef something_like_tuple<char, int, float> something_like_tuple_t;

    std::cout << is_last<float, something_like_tuple_t>::value << std::endl; /*
<-- line 23 */
    std::cout << is_last<int, something_like_tuple_t>::value << std::endl;
}

g++ invoked as following:

g++ --std=c++11 test.cpp -o test

Output:
test.cpp: In function âint main(int, char**)â:
test.cpp:23:53: internal compiler error: in unify, at cp/pt.c:16952
Please submit a full bug report,
with preprocessed source if appropriate.

g++ -v
Using built-in specs.
COLLECT_GCC=##I believe not relevant##
COLLECT_LTO_WRAPPER=##I believe not relevant##
Target: i686-pc-linux-gnu
Configured with: ./configure --prefix=##I believe not relevant##
--enable-threads=posix --enable-shared --enable-checking=release
--enable-languages=c,c++ i686-pc-linux-gnu --with-mpc-include=##I believe not
relevant## --with-mpc-lib=##I believe not relevant##
Thread model: posix
gcc version 4.7.1 (GCC)

Reply via email to