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.0rc2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.law/] [enum4.C] - Rev 384
Compare with Previous | Blame | View Log
// { dg-do assemble }
// GROUPS passed enums
// enum file
// From: dougm@cs.rice.edu (Doug Moore)
// Date: Thu, 18 Mar 93 00:14:57 CST
// Subject: 2.3.3:Inconsistent behavior for enum conversions
// Message-ID: <9303180614.AA12123@cs.rice.edu>
enum Enum {enumerator1, enumerator2};
struct Struct
{
int i;
int getI(Enum) {return i;} // { dg-message "candidate is" }
};
int funct (Enum)
{
return 0;
}
int main()
{
Enum e = enumerator1;
Struct s;
int x = funct(e+1);// { dg-error "invalid" }
int y = s.getI(e+1);// { dg-error "match" }
return x+y;
}