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++.dg/] [init/] [assign1.C] - Diff between revs 301 and 338

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

Rev 301 Rev 338
// PR c++/13009
// PR c++/13009
// { dg-do run }
// { dg-do run }
struct A {
struct A {
  char a;
  char a;
};
};
struct B: public virtual A {
struct B: public virtual A {
  #if 0 // this piece of code works around the problem
  #if 0 // this piece of code works around the problem
  B& operator= (const B& other)
  B& operator= (const B& other)
  {
  {
    A::operator= (other);
    A::operator= (other);
  }
  }
  #endif
  #endif
};
};
struct C: public B {
struct C: public B {
  char c;
  char c;
};
};
int main() {
int main() {
  B b;
  B b;
  b.a = 'b';
  b.a = 'b';
  C c;
  C c;
  c.a = c.c = 'c';
  c.a = c.c = 'c';
  c.B::operator= (b);
  c.B::operator= (b);
  if (c.a != 'b' || c.c != 'c')
  if (c.a != 'b' || c.c != 'c')
    return 1;
    return 1;
}
}
 
 

powered by: WebSVN 2.1.0

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