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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [init/] [assign1.C] - Rev 693

Compare with Previous | Blame | View Log

// PR c++/13009
// { dg-do run }

struct A {
  char a;
};

struct B: public virtual A {
  #if 0 // this piece of code works around the problem
  B& operator= (const B& other)
  {
    A::operator= (other);
  }
  #endif
};

struct C: public B {
  char c;
};

int main() {
  B b;
  b.a = 'b';
  C c;
  c.a = c.c = 'c';
  
  c.B::operator= (b);
  if (c.a != 'b' || c.c != 'c')
    return 1;
}

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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