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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [init/] [array12.C] - Diff between revs 149 and 154

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

Rev 149 Rev 154
// PR c++/12253
// PR c++/12253
// Bug: We were failing to destroy the temporary A passed to the
// Bug: We were failing to destroy the temporary A passed to the
// constructor for b[0] before going on to construct b[1].
// constructor for b[0] before going on to construct b[1].
// { dg-do run }
// { dg-do run }
extern "C" int printf (const char *, ...);
extern "C" int printf (const char *, ...);
int c;
int c;
int r;
int r;
struct A
struct A
{
{
  A() { printf ("A()\n"); if (c++) r = 1; }
  A() { printf ("A()\n"); if (c++) r = 1; }
  A(const A&) { printf ("A(const A&)\n"); ++c; }
  A(const A&) { printf ("A(const A&)\n"); ++c; }
  ~A() { printf ("~A()\n"); --c; }
  ~A() { printf ("~A()\n"); --c; }
};
};
struct B
struct B
{
{
  B(int, const A& = A()) { printf ("B()\n"); }
  B(int, const A& = A()) { printf ("B()\n"); }
};
};
int main()
int main()
{
{
  B b[] = { 0, 0 };
  B b[] = { 0, 0 };
  return r;
  return r;
}
}
 
 

powered by: WebSVN 2.1.0

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