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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.robertl/] [eb109.C] - Diff between revs 149 and 154

Only display areas with differences | Details | Blame | View Log

Rev 149 Rev 154
// { dg-do assemble  }
// { dg-do assemble  }
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
using namespace std;
// empty parameter class with a minimal set of operations
// empty parameter class with a minimal set of operations
// if there are no weights for edges necessary
// if there are no weights for edges necessary
struct Empty
struct Empty
{
{
  public:
  public:
    Empty(int=0) {}
    Empty(int=0) {}
    bool operator<(const Empty&) const { return true;}
    bool operator<(const Empty&) const { return true;}
};
};
inline ostream& operator<<(ostream& os, const Empty&) { return os;}
inline ostream& operator<<(ostream& os, const Empty&) { return os;}
inline istream& operator>>(istream& is, Empty& ) { return is;}
inline istream& operator>>(istream& is, Empty& ) { return is;}
template
template
class Graph
class Graph
{  // { dg-error "" } candidates
{  // { dg-error "" } candidates
  public:
  public:
    // public type interface
    // public type interface
    typedef std::map Successor;
    typedef std::map Successor;
    typedef std::pair vertex;
    typedef std::pair vertex;
    typedef std::vector GraphType;
    typedef std::vector GraphType;
    typedef typename GraphType::iterator iterator;
    typedef typename GraphType::iterator iterator;
    typedef typename GraphType::const_iterator const_iterator;
    typedef typename GraphType::const_iterator const_iterator;
  // a lot of stuff deleted ....
  // a lot of stuff deleted ....
  private:
  private:
    bool directed;
    bool directed;
    GraphType C;          // container
    GraphType C;          // container
    ostream* pOut;
    ostream* pOut;
};
};
// all graph-methods delet
// all graph-methods delet
template
template
ostream& operator<<(ostream& os, Graph& G)
ostream& operator<<(ostream& os, Graph& G)
{
{
    // display of vertices with successors
    // display of vertices with successors
  for(int i = 0; i < G.size(); ++i)  // { dg-error "" } no size function
  for(int i = 0; i < G.size(); ++i)  // { dg-error "" } no size function
    {
    {
      os << G[i].first << " <";      // { dg-error "" } no index operator
      os << G[i].first << " <";      // { dg-error "" } no index operator
        // The compiler does not like this line!!!!!!
        // The compiler does not like this line!!!!!!
        typename Graph::Successor::iterator
        typename Graph::Successor::iterator
          startN = G[i].second.begin(), // { dg-error "" } no index operator
          startN = G[i].second.begin(), // { dg-error "" } no index operator
          endN   = G[i].second.end();  // { dg-error "" } no index operator
          endN   = G[i].second.end();  // { dg-error "" } no index operator
        while(startN != endN)
        while(startN != endN)
        {
        {
            os << G[(*startN).first].first << ' ' // { dg-error "" } no index operator
            os << G[(*startN).first].first << ' ' // { dg-error "" } no index operator
               << (*startN).second << ' ';
               << (*startN).second << ' ';
            ++startN;
            ++startN;
        }
        }
        os << ">\n";
        os << ">\n";
    }
    }
    return os;
    return os;
}
}
int main()
int main()
{
{
    // no edge weighting, therefore type Empty:
    // no edge weighting, therefore type Empty:
    Graph V(true);        // { dg-error "" } no bool constructor
    Graph V(true);        // { dg-error "" } no bool constructor
    // ReadGraph(V, "gra1.dat");
    // ReadGraph(V, "gra1.dat");
    // display of vertices with successors
    // display of vertices with successors
    cout << V;
    cout << V;
}
}
 
 

powered by: WebSVN 2.1.0

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