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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.pt/] [parms1.C] - Diff between revs 149 and 154

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 149 Rev 154
// { dg-do run  }
// { dg-do run  }
// Testcase for use of template parms as types for other template parms.
// Testcase for use of template parms as types for other template parms.
template 
template 
class A {
class A {
    T   a;
    T   a;
public:
public:
    A(): a(t) {}
    A(): a(t) {}
    operator T () { return a; }
    operator T () { return a; }
};
};
template 
template 
class B {
class B {
    A a;
    A a;
public:
public:
    B(A& b): a(b) {}
    B(A& b): a(b) {}
    operator S () { return a*20; }
    operator S () { return a*20; }
};
};
int
int
main()
main()
{
{
    A a;
    A a;
    B b(a);
    B b(a);
    if (b * a == 500)
    if (b * a == 500)
      return 0;
      return 0;
    else
    else
      return 1;
      return 1;
}
}
 
 

powered by: WebSVN 2.1.0

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