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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.eh/] [vbase4.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do run  }
2
 
3
// Copyright (C) 2000 Free Software Foundation, Inc.
4
// Contributed by Nathan Sidwell 8 Mar 2000 
5
 
6
// Derived from PR#7
7
 
8
// We need to destroy the thrown object when exiting the catch
9
// clause. That needs to destroy the original thrown object, not
10
// the caught one (which might be a base).
11
 
12
static int ok = 0;
13
 
14
struct A
15
{
16
  A (){}
17
  virtual ~A () {}
18
};
19
 
20
struct B : virtual A
21
{
22
  int value;
23
  B ()
24
    :value(10)
25
    {}
26
  ~B()
27
  {
28
    if (value == 10)
29
      ok = 1;
30
  }
31
};
32
 
33
int main()
34
{
35
  try {
36
    throw B ();
37
  } catch (A & e) {
38
  }
39
  return !ok;
40
}

powered by: WebSVN 2.1.0

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