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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [eh/] [ehopt1.C] - Blame information for rev 717

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

Line No. Rev Author Line
1 693 jeremybenn
// ehopt was only copying one statement from the cleanup of the B temporary
2
// into the following try block, so we lost its destructor call.
3
 
4
// { dg-do run }
5
 
6
template 
7
class A;
8
 
9
bool b;
10
int count;
11
 
12
template <>
13
class A
14
{
15
public:
16
  A(int) { ++count; if (b) throw 1; }
17
  A(const A&) { ++count; if (b) throw 1; }
18
  ~A() { --count; if (b) throw 1; }
19
};
20
 
21
typedef A B;
22
 
23
template <>
24
class A
25
{
26
public:
27
  A() { if (b) throw 1; }
28
  A(const B&) { if (b) throw 1; }
29
  ~A() { if (b) throw 1; }
30
};
31
 
32
typedef A C;
33
 
34
void f() { if (b) throw 1; }
35
 
36
int
37
main (void)
38
{
39
  {
40
    C a(1);
41
    f();
42
  }
43
  return count;
44
}

powered by: WebSVN 2.1.0

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