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++.law/] [dtors3.C] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
// { dg-do run  }
2
// GROUPS passed destructors
3
// dtor file
4
// Message-Id: <9301242117.AA04053@cs.rice.edu>
5
// From: dougm@cs.rice.edu (Doug Moore)
6
// Subject: 2.3.3: premature dtor of temp?
7
// Date: Sun, 24 Jan 93 15:17:07 CST
8
 
9
#include 
10
#include 
11
 
12
int killed = 0;
13
 
14
class Foo
15
{
16
  int a;
17
public:
18
  Foo()
19
  :a(0) {;}
20
  ~Foo() { killed++;}
21
  Foo& operator << (int b)
22
  {
23
    a += b;
24
    if (killed)
25
      {
26
        printf ("FAIL\n");
27
        exit (1);
28
      }
29
    return *this;
30
  }
31
};
32
 
33
int main()
34
{
35
  Foo() << 1 << 3 << 5 << 7;
36
  printf ("PASS\n");
37
}
38
 

powered by: WebSVN 2.1.0

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