OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [lambda/] [lambda-eh.C] - Blame information for rev 378

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

Line No. Rev Author Line
1 301 jeremybenn
// Test that we properly clean up if we get an exception in the middle of
2
// constructing the closure object.
3
// { dg-options -std=c++0x }
4
 
5
// This test fails because of PR 41449; it isn't a lambda issue.
6
// { dg-do run { xfail *-*-* } }
7
 
8
struct A
9
{
10
  A() {}
11
  A(const A&) { throw 1; }
12
};
13
 
14
int bs;
15
struct B
16
{
17
  B() { ++bs; }
18
  B(const B&) { ++bs; }
19
  ~B() { --bs; }
20
};
21
 
22
int main()
23
{
24
  {
25
    B b1, b2;
26
    A a;
27
 
28
    try
29
      {
30
        [b1, a, b2]{ };
31
      }
32
    catch(...) {}
33
  }
34
  return bs;
35
}

powered by: WebSVN 2.1.0

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