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++.bugs/] [900121_02.C] - Diff between revs 305 and 338

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

Rev 305 Rev 338
// { dg-do assemble  }
// { dg-do assemble  }
// g++ 1.36.1 bug 900121_02
// g++ 1.36.1 bug 900121_02
// Assignment of structs is defined as memberwise assignment,
// Assignment of structs is defined as memberwise assignment,
// however g++ (1.36.2) and Cfront 2.0 differ on the definition
// however g++ (1.36.2) and Cfront 2.0 differ on the definition
// of assignment for unions.
// of assignment for unions.
// (NOTE: Stroustrup now says that assignment of unions which contain either
// (NOTE: Stroustrup now says that assignment of unions which contain either
// members or sub-members (base classes are not allowed for unions) which
// members or sub-members (base classes are not allowed for unions) which
// have non-default assignment operators defined for them will be illegal
// have non-default assignment operators defined for them will be illegal
// in future.)
// in future.)
// g++ (1.36.2) on the other hand, accepts this program without errors.
// g++ (1.36.2) on the other hand, accepts this program without errors.
// keywords: unions, operator=, inheritance, members
// keywords: unions, operator=, inheritance, members
struct s0 {
struct s0 {
  int i;
  int i;
  void operator= (s0 & arg)
  void operator= (s0 & arg)
  {
  {
    this->i = arg.i;
    this->i = arg.i;
  }
  }
};
};
struct s1 {
struct s1 {
  double d;
  double d;
  void operator= (s1 & arg)
  void operator= (s1 & arg)
  {
  {
    this->d = arg.d;
    this->d = arg.d;
  }
  }
};
};
union u0 {
union u0 {
  s0 u0_member_0;               // { dg-error "" }
  s0 u0_member_0;               // { dg-error "" }
  s1 u0_member_1;               // { dg-error "" }
  s1 u0_member_1;               // { dg-error "" }
};
};
void function ()
void function ()
{
{
  u0 u0_object_0;
  u0 u0_object_0;
  u0 u0_object_1;
  u0 u0_object_1;
  u0_object_0 = u0_object_1;
  u0_object_0 = u0_object_1;
}
}
int main () { return 0; }
int main () { return 0; }
 
 

powered by: WebSVN 2.1.0

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