OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.brendan/] [cvt1.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  }
// GROUPS passed conversions
// GROUPS passed conversions
#include 
#include 
class Thing
class Thing
{
{
public:
public:
      typedef enum { GOOD_THING, BAD_THING, } ThingType ; // { dg-error "" } comma
      typedef enum { GOOD_THING, BAD_THING, } ThingType ; // { dg-error "" } comma
        Thing (ThingType type) : thingType (type) { }
        Thing (ThingType type) : thingType (type) { }
        ~Thing () { }
        ~Thing () { }
private:
private:
        ThingType thingType ;
        ThingType thingType ;
} ;
} ;
class Group
class Group
{
{
public:
public:
      typedef enum { THIS_GROUP, THAT_GROUP, } GroupType ; // { dg-error "" } comma
      typedef enum { THIS_GROUP, THAT_GROUP, } GroupType ; // { dg-error "" } comma
        Group (GroupType type) : groupType (type), groupCount (0) { }
        Group (GroupType type) : groupType (type), groupCount (0) { }
        ~Group () { }
        ~Group () { }
        void append (Thing* const &entry) { groupCount ++ ; }
        void append (Thing* const &entry) { groupCount ++ ; }
        operator GroupType () const { return groupType ; }
        operator GroupType () const { return groupType ; }
        operator int () const { return groupCount ; } // remove this and problem gone
        operator int () const { return groupCount ; } // remove this and problem gone
private:
private:
        int groupCount ;
        int groupCount ;
        GroupType groupType ;
        GroupType groupType ;
} ;
} ;
inline Group& operator += (Group& g, Thing* const t)
inline Group& operator += (Group& g, Thing* const t)
{
{
        g.append (t) ;
        g.append (t) ;
        return g ; // complaint is here
        return g ; // complaint is here
}
}
int
int
main (int argc, char** argv)
main (int argc, char** argv)
{
{
        Group g (Group::THIS_GROUP) ;
        Group g (Group::THIS_GROUP) ;
        g += new Thing (Thing::GOOD_THING) ;
        g += new Thing (Thing::GOOD_THING) ;
        std::cout << "Group type is " << (Group::GroupType) g << std::endl ;
        std::cout << "Group type is " << (Group::GroupType) g << std::endl ;
        return 0 ;
        return 0 ;
}
}
 
 

powered by: WebSVN 2.1.0

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