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


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

--- Comment #1 from Roger Ferrer Ibanez <roger.ferrer at bsc dot es> 2012-07-03 08:28:59 UTC ---
A similar problem happens when template-type parameters are involved.

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

template <typename Q>
void g2()
{
    const int M  ( sizeof(Q) );
    A<M> a;
}

void h()
{
    g2<int>();
}

$ g++ -c test2.cc
test2.cc: In function âvoid g2()â:
test2.cc:8:8: error: the value of âMâ is not usable in a constant expression
test2.cc:7:15: note: âMâ was not initialized with a constant expression
test2.cc:8:8: note: in template argument for type âintâ 
test2.cc:8:11: error: invalid type in declaration before â;â token

Should I open another PR for that one?


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