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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [overload/] [cond1.C] - Blame information for rev 154

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
// Test that converting a COND_EXPR to void doesn't result in trying to
2
// bitwise copy a class with a nontrivial copy constructor (and thus a
3
// compiler abort).
4
 
5
// { dg-options "-O" }
6
 
7
struct A {
8
  virtual ~A() { }
9
};
10
 
11
A a1, a2;
12
inline A& one () { return a1; }
13
inline A& two () { return a2; }
14
 
15
inline void f (int i)
16
{
17
  i ? a1 : a2;
18
  i ? one() : two();
19
}
20
 
21
int main ()
22
{
23
  f (1);
24
}

powered by: WebSVN 2.1.0

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