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++.dg/] [overload/] [cond1.C] - Diff between revs 149 and 154

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

Rev 149 Rev 154
// Test that converting a COND_EXPR to void doesn't result in trying to
// Test that converting a COND_EXPR to void doesn't result in trying to
// bitwise copy a class with a nontrivial copy constructor (and thus a
// bitwise copy a class with a nontrivial copy constructor (and thus a
// compiler abort).
// compiler abort).
// { dg-options "-O" }
// { dg-options "-O" }
struct A {
struct A {
  virtual ~A() { }
  virtual ~A() { }
};
};
A a1, a2;
A a1, a2;
inline A& one () { return a1; }
inline A& one () { return a1; }
inline A& two () { return a2; }
inline A& two () { return a2; }
inline void f (int i)
inline void f (int i)
{
{
  i ? a1 : a2;
  i ? a1 : a2;
  i ? one() : two();
  i ? one() : two();
}
}
int main ()
int main ()
{
{
  f (1);
  f (1);
}
}
 
 

powered by: WebSVN 2.1.0

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