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] - Rev 301

Compare with Previous | Blame | View Log

// Test that we properly clean up if we get an exception in the middle of
// constructing the closure object.
// { dg-options -std=c++0x }

// This test fails because of PR 41449; it isn't a lambda issue.
// { dg-do run { xfail *-*-* } }

struct A
{
  A() {}
  A(const A&) { throw 1; }
};

int bs;
struct B
{
  B() { ++bs; }
  B(const B&) { ++bs; }
  ~B() { --bs; }
};

int main()
{
  {
    B b1, b2;
    A a;

    try
      {
        [b1, a, b2]{ };
      }
    catch(...) {}
  }
  return bs;
}

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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