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++/53836] New: ICE: unexpected expression of kind template_parm_index


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

             Bug #: 53836
           Summary: ICE: unexpected expression of kind template_parm_index
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: roger.ferrer@bsc.es


Created attachment 27733
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27733
Preprocessed source

Hello,

the following testcase fails to compile in g++ 4.7.1

// -- test.cc
template <int N>
struct A { };

template <int Q>
void g()
{
    const int M ( Q );

    A<M> a;
}

void h()
{
    g<3>();
}

$ g++ -c test.cc
test.cc: In function âvoid g()â:
test.cc:9:8: internal compiler error: unexpected expression âQâ of kind
template_parm_index
Please submit a full bug report,
with preprocessed source if appropriate.
Preprocessed source stored into /tmp/cc7IeEc0.out file, please attach this to
your bugreport.

Using 'const int M = Q;' instead works fine.

g++ 4.4 and g++ 4.5 fail (without an ICE), but g++ 4.6.3 works fine so it looks
to me as a 4.7 regression.

Kind regards,


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