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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.law/] [virtual3.C] - Blame information for rev 699

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do run  }
2
// GROUPS passed virtual-functions
3
// virtual file
4
// From: allan@ramjet.multinet.DE (Allan Brighton)
5
// Subject: pos. bug in gcc-2.5.2 on hp
6
// Date: 4 Nov 1993 22:57:36 -0500
7
// Message-ID: <9311041820.AA05942@ramjet.multinet.DE>
8
 
9
#include 
10
#include 
11
 
12
using namespace std;
13
 
14
class BugStream : public ostringstream {
15
public:
16
    BugStream() {}
17
    BugStream& eval();
18
};
19
 
20
 
21
static struct Eval_ { } eval;
22
BugStream& operator<<(ostream& os, Eval_);
23
 
24
BugStream& BugStream::eval()
25
{
26
   // make sure str is null terminated
27
   *this << ends;
28
 
29
   // eval the command and set the status
30
   const char* s = str().data();
31
   cerr << s << endl;
32
 
33
   // reset the stream for the next command
34
   clear(ios::goodbit);
35
   //   rdbuf()->freeze(0);
36
   seekp(0);
37
 
38
   return *this;
39
}
40
 
41
BugStream& operator<<(ostream& os, Eval_)
42
{
43
    return ((BugStream&)os).eval();
44
}
45
 
46
int main() {
47
    BugStream bs;
48
    bs << "PASS" << eval;
49
}

powered by: WebSVN 2.1.0

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