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/] [arg9.C] - Blame information for rev 699

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do assemble  }
2
// GROUPS passed arg-matching
3
// arg-matching file
4
// Message-Id: <199405132049.QAA06835@elan.cs.UMD.EDU>
5
// Subject: Bug in g++ 2.4.5 and 2.5.8
6
// Date: Fri, 13 May 1994 16:49:22 -0400
7
// From: Evan Rosser 
8
 
9
#include 
10
#include 
11
#include 
12
 
13
class TupleIterator {
14
public:
15
    TupleIterator(int *tpl);
16
    int& operator*();
17
    int  live() const;
18
// The compile fails with "no post-increment operator for type" at "TI++"
19
// below.
20
// It succeeds with the same declarations if set_position does not take an int.
21
// This occurs with G++ 2.4.5 and 2.5.8.
22
// Sun CC works OK with either case.
23
        void operator++(int);
24
        void set_position(int);
25
private:
26
};
27
 
28
int main() {
29
 
30
int t[5];
31
t[1] = 1; t[2] = 2;t[3] = 3;t[4] = 4;
32
TupleIterator TI(t);
33
 
34
    while(TI.live()){
35
        printf("%d", *TI);
36
        TI++;
37
    }
38
}
39
 

powered by: WebSVN 2.1.0

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