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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do assemble  }
2
#include
3
#include
4
#include
5
#include
6
 
7
using namespace std;
8
 
9
// empty parameter class with a minimal set of operations
10
// if there are no weights for edges necessary
11
struct Empty
12
{
13
  public:
14
    Empty(int=0) {}
15
    bool operator<(const Empty&) const { return true;}
16
};
17
inline ostream& operator<<(ostream& os, const Empty&) { return os;}
18
inline istream& operator>>(istream& is, Empty& ) { return is;}
19
 
20
 
21
template
22
class Graph                     // { dg-message "note" } candidates
23
{
24
  public:
25
    // public type interface
26
    typedef std::map Successor;
27
    typedef std::pair vertex;
28
    typedef std::vector GraphType;
29
    typedef typename GraphType::iterator iterator;
30
    typedef typename GraphType::const_iterator const_iterator;
31
 
32
  // a lot of stuff deleted ....
33
 
34
  private:
35
    bool directed;
36
    GraphType C;          // container
37
    ostream* pOut;
38
};
39
 
40
// all graph-methods delet
41
template
42
ostream& operator<<(ostream& os, Graph& G)
43
{
44
    // display of vertices with successors
45
  for(int i = 0; i < G.size(); ++i)  // { dg-error "no member" } no size function
46
    {
47
      os << G[i].first << " <";      // { dg-error "no match" } no index operator
48
 
49
        // The compiler does not like this line!!!!!!
50
        typename Graph::Successor::iterator
51
          startN = G[i].second.begin(), // { dg-error "no match" } no index operator
52
          endN   = G[i].second.end();  // { dg-error "no match" } no index operator
53
 
54
        while(startN != endN)
55
        {
56
            os << G[(*startN).first].first << ' ' // { dg-error "no match" } no index operator
57
               << (*startN).second << ' ';
58
            ++startN;
59
        }
60
        os << ">\n";
61
    }
62
    return os;
63
}
64
 
65
int main()
66
{
67
    // no edge weighting, therefore type Empty:
68
    Graph V(true);        // { dg-error "no match" } no bool constructor
69
    // { dg-message "candidate" "candidate note" { target *-*-* } 68 }
70
    // ReadGraph(V, "gra1.dat");
71
 
72
    // display of vertices with successors
73
    cout << V;
74
 
75
}

powered by: WebSVN 2.1.0

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