OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [template/] [partial1.C] - Diff between revs 154 and 816

Only display areas with differences | Details | Blame | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.