summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.robertl/eb15.C
blob: 1cb9fd15c835122771a3a9f8169040fbc9562c96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// { dg-do assemble  }
#include<iostream>
#include<cstddef>

struct A {
  A() {
    std::cerr<<"A constructing\n";
    throw 1;
  }
  void *operator new(size_t sz) {
    std::cerr<<"A allocated\n";
    return ::operator new(sz);
  }
  void operator delete (void *p) {
    std::cerr<<"A deleted\n";
    ::operator delete (p);
  }
};

int main() {
  try {
     new A();
  } catch (...) {
  }
}