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

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.jason/] [ref7.C] - Blame information for rev 384

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do run  }
2
// Testcase for the lifetime of a temporary object which is used to
3
// initialize a reference.
4
 
5
int destroyed = 0;
6
 
7
struct A {
8
  A() { }
9
  A(int) { }
10
  ~A() { destroyed++; }
11
};
12
 
13
A a;
14
A foo () { return a; }
15
 
16
int main()
17
{
18
  const A& ar = foo();
19
  const A& ar2 = A();
20
  const A& ar3 = (A)1;
21
  return destroyed;
22
}

powered by: WebSVN 2.1.0

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