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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [init/] [array12.C] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
// PR c++/12253
2
// Bug: We were failing to destroy the temporary A passed to the
3
// constructor for b[0] before going on to construct b[1].
4
 
5
// { dg-do run }
6
 
7
extern "C" int printf (const char *, ...);
8
 
9
int c;
10
int r;
11
 
12
struct A
13
{
14
  A() { printf ("A()\n"); if (c++) r = 1; }
15
  A(const A&) { printf ("A(const A&)\n"); ++c; }
16
  ~A() { printf ("~A()\n"); --c; }
17
};
18
 
19
struct B
20
{
21
  B(int, const A& = A()) { printf ("B()\n"); }
22
};
23
 
24
int main()
25
{
26
  B b[] = { 0, 0 };
27
  return r;
28
}

powered by: WebSVN 2.1.0

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