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++.dg/] [eh/] [elide1.C] - Diff between revs 301 and 338

Only display areas with differences | Details | Blame | View Log

Rev 301 Rev 338
// PR c++/13944
// PR c++/13944
// Bug: When eliding the copy from the A temporary into the exception
// Bug: When eliding the copy from the A temporary into the exception
// object, we extended the throw prohibition to the constructor for the
// object, we extended the throw prohibition to the constructor for the
// temporary.  This is wrong; the throw from A() should propagate normally
// temporary.  This is wrong; the throw from A() should propagate normally
// regardless of the elision of the temporary.
// regardless of the elision of the temporary.
// { dg-do run }
// { dg-do run }
struct A
struct A
{
{
  A() { throw 0; }
  A() { throw 0; }
};
};
int main()
int main()
{
{
  try
  try
    {
    {
      throw A();
      throw A();
    }
    }
  catch(int i)
  catch(int i)
    {
    {
      return i;
      return i;
    }
    }
  catch (...)
  catch (...)
    {
    {
      return 2;
      return 2;
    }
    }
  return 3;
  return 3;
}
}
 
 

powered by: WebSVN 2.1.0

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