OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.jason/] [temporary8.C] - Blame information for rev 305

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do run  }
2
// Test for proper handling of temporaries in ?: exprs.
3
 
4
extern "C" int printf (const char *, ...);
5
int c = 0, d = 0;
6
 
7
class A {
8
public:
9
  A() { ++c; }
10
  A(const A&) { ++c; }
11
  ~A() { ++d; }
12
};
13
 
14
A f (const A& a)
15
{
16
  return (c ? A() : A());
17
}
18
 
19
int main()
20
{
21
  {
22
    f (c ? A() : A());
23
  }
24
  printf ("%d %d\n", c, d);
25
  return c != d || c != 2;
26
}

powered by: WebSVN 2.1.0

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