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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-dev/] [fsf-gcc-snapshot-1-mar-12/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [dc6.C] - Diff between revs 693 and 783

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

Rev 693 Rev 783
// { dg-do run { target c++11 } }
// { dg-do run { target c++11 } }
int a_ct;
int a_ct;
struct A
struct A
{
{
  A(int i): i(i) { ++a_ct; }
  A(int i): i(i) { ++a_ct; }
  A(const A& a): i(a.i) { ++a_ct; }
  A(const A& a): i(a.i) { ++a_ct; }
  ~A() { --a_ct; }
  ~A() { --a_ct; }
  int i;
  int i;
};
};
struct V
struct V
{
{
  V() { }
  V() { }
};
};
struct B: virtual V
struct B: virtual V
{
{
  A a;
  A a;
  B(A a): a(a) { }
  B(A a): a(a) { }
  B(int i): B(A(i)) { }
  B(int i): B(A(i)) { }
};
};
struct C: B
struct C: B
{
{
  C(int i): B(i) { }
  C(int i): B(i) { }
};
};
int main()
int main()
{
{
  {
  {
    B b(42);
    B b(42);
    C c(24);
    C c(24);
    if (b.a.i != 42
    if (b.a.i != 42
        ||c.a.i != 24)
        ||c.a.i != 24)
      __builtin_abort ();
      __builtin_abort ();
  }
  }
  return a_ct;
  return a_ct;
}
}
 
 

powered by: WebSVN 2.1.0

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