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++/55494] New: ICE for char array or int in variadic template


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

             Bug #: 55494
           Summary: ICE for char array or int in variadic template
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jondreads@gmail.com


The following code generates internal compiler error: in unify_one_argument, at
cp/pt.c:15267
The error is generated if the template argument to Foo is a char array or int.
It is not generated if it is a struct.

gcc version 4.7.2.20120921 (Red Hat 4.7.2-2)
Target: x86_64-redhat-linux



struct S {};

template <char const * Name>
struct Foo {};

template <typename...Args>
void operator<<(S& os, Foo<Args...>& m)
{
}

char test[] = "test";

int main()
{
    S s;
    Foo<test> m;
    s << m;
}


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