This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53836] ICE: unexpected expression of kind template_parm_index
- From: "roger.ferrer at bsc dot es" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 03 Jul 2012 08:28:59 +0000
- Subject: [Bug c++/53836] ICE: unexpected expression of kind template_parm_index
- Auto-submitted: auto-generated
- References: <bug-53836-4@http.gcc.gnu.org/bugzilla/>
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?