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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.oliva/] [delete3.C] - Blame information for rev 699

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do run  }
2
// Copyright (C) 1999 Free Software Foundation
3
 
4
// by Alexandre Oliva 
5
 
6
// Test whether dtors of vbases are called on throw within new[].
7
// Variant of delete2.C.
8
 
9
extern "C" void abort();
10
extern "C" void exit(int);
11
 
12
struct Foo {
13
  static bool first;
14
 
15
  Foo() {
16
    if (first)
17
      first = false;
18
    else
19
      throw first;
20
  }
21
 
22
  ~Foo() {
23
    exit(0);
24
  }
25
};
26
 
27
bool Foo::first = true;
28
 
29
struct Bar : virtual Foo {
30
};
31
 
32
int main() {
33
  try {
34
    delete [] new Bar[2];
35
  } catch (...) {
36
  }
37
  abort();
38
}

powered by: WebSVN 2.1.0

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