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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.jason/] [temporary4.C] - Rev 823

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

// { dg-do run  }
// Bug: g++ initializes both B::i and B::j before destroying any temps.

extern "C" int printf (const char *, ...);

int c = 0;
int d = 0;
int r = 0;

struct A {
  A() { if (c != d) r = 1; ++c; }
  A(const A&);  // declare so g++ returns A on the stack
  ~A() { ++d; }
  operator int () { return 0; }
};

A foo ()
{
  return A();
}

struct B {
  int i;
  int j;
  B(): i(foo()), j(foo()) { }
};

int main()
{
  B b;
  return r;
}

Go to most recent revision | 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.