// { dg-do run } // Origin: Jo Totland // PR c++/6620 // Partial specialization involving expression of non-type template // parameter causes ICE. extern "C" void abort(); template struct HoldInt { }; template struct Add { }; template struct Add, HoldInt<-N> > { typedef int type; int f() { return 0; } }; template struct Add, HoldInt > { typedef HoldInt type; int f() { return 1; } }; int main() { Add, HoldInt<-1> > a; Add, HoldInt<-2> > b; if (a.f() != 0 || b.f() != 1) abort(); }