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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.jason/] [template27.C] - Diff between revs 305 and 338

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

Rev 305 Rev 338
// { dg-do run  }
// { dg-do run  }
// PRMS Id: 6826
// PRMS Id: 6826
// Check that unnecessary templates are not instantiated.
// Check that unnecessary templates are not instantiated.
template 
template 
class Test
class Test
{
{
 public:
 public:
  void doThiss();
  void doThiss();
  void doThat();
  void doThat();
};
};
template 
template 
void Test::doThiss()
void Test::doThiss()
{
{
  T x;
  T x;
  x.thiss();
  x.thiss();
}
}
template 
template 
void Test::doThat()
void Test::doThat()
{
{
  T x;
  T x;
  x.that();
  x.that();
}
}
class A
class A
{
{
 public:
 public:
  void thiss() {}
  void thiss() {}
};
};
class B
class B
{
{
 public:
 public:
  void that() {}
  void that() {}
};
};
int main()
int main()
{
{
  Test a;
  Test a;
  a.doThiss();                  // a.doThat() is not well formed, but then
  a.doThiss();                  // a.doThat() is not well formed, but then
                                // it's not used so needn't be instantiated.
                                // it's not used so needn't be instantiated.
  Test b;
  Test b;
  b.doThat();                   // simillarly b.doThiss();
  b.doThat();                   // simillarly b.doThiss();
}
}
 
 

powered by: WebSVN 2.1.0

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