8sa1-gcc/gcc/testsuite/g++.old-deja/g++.law/enum4.C
Jeff Law 921e5a0eb4 Initial revision
From-SVN: r14840
1997-08-19 01:34:40 -06:00

30 lines
543 B
C

// Build don't link:
// 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;} // ERROR - candidates
};
int funct (Enum)
{
return 0;
}
int main()
{
Enum e = enumerator1;
Struct s;
int x = funct(e+1);// ERROR - .*
int y = s.getI(e+1);// ERROR - .*
return x+y;
}