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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.other/] [inline14.C] - Diff between revs 305 and 338

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

Rev 305 Rev 338
// { dg-do assemble  }
// { dg-do assemble  }
// Origin: Gerald Pfeifer 
// Origin: Gerald Pfeifer 
#include 
#include 
struct IDENT
struct IDENT
    {
    {
    enum TYPE { Variable, Constant } type;
    enum TYPE { Variable, Constant } type;
    std::ostream& printTo(std::ostream& out) const
    std::ostream& printTo(std::ostream& out) const
        {
        {
        switch (type)
        switch (type)
            {
            {
            case Variable:
            case Variable:
                out << '_';
                out << '_';
                break;
                break;
            default:
            default:
                break;
                break;
            }
            }
        return out;
        return out;
        }
        }
    };
    };
template 
template 
struct TC
struct TC
    {
    {
    IDENT i;
    IDENT i;
    const IDENT& getIdent() const
    const IDENT& getIdent() const
        {
        {
        return i;
        return i;
        }
        }
    };
    };
template 
template 
inline std::ostream& operator<< (std::ostream& out, const TC &c)
inline std::ostream& operator<< (std::ostream& out, const TC &c)
    {
    {
    c.getIdent().printTo(out);
    c.getIdent().printTo(out);
    return out;
    return out;
    }
    }
void foo(const TC &c)
void foo(const TC &c)
    {
    {
    std::cerr << c
    std::cerr << c
         << ": " // This line is crucial!
         << ": " // This line is crucial!
         << c
         << c
         << std::endl;
         << std::endl;
    }
    }
 
 

powered by: WebSVN 2.1.0

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