2 // GROUPS passed conversions
8 typedef enum { GOOD_THING, BAD_THING, } ThingType ; // { dg-error "" "comma" { target { ! c++11 } } }
9 Thing (ThingType type) : thingType (type) { }
18 typedef enum { THIS_GROUP, THAT_GROUP, } GroupType ; // { dg-error "" "comma" { target { ! c++11 } } }
19 Group (GroupType type) : groupType (type), groupCount (0) { }
21 void append (Thing* const &entry) { groupCount ++ ; }
22 operator GroupType () const { return groupType ; }
23 operator int () const { return groupCount ; } // remove this and problem gone
30 inline Group& operator += (Group& g, Thing* const t)
33 return g ; // complaint is here
37 main (int argc, char** argv)
39 Group g (Group::THIS_GROUP) ;
41 g += new Thing (Thing::GOOD_THING) ;
42 std::cout << "Group type is " << (Group::GroupType) g << std::endl ;