1 // { dg-do assemble  }
2 // GROUPS passed enums
3 // enum file
4 // From: dougm@cs.rice.edu (Doug Moore)
5 // Date:     Thu, 18 Mar 93 00:14:57 CST
6 // Subject:  2.3.3:Inconsistent behavior for enum conversions
7 // Message-ID: <9303180614.AA12123@cs.rice.edu>
8 
9 enum Enum {enumerator1, enumerator2};
10 
11 struct Struct
12 {
13   int i;
getIStruct14       int getI(Enum) {return i;} // { dg-message "Struct::getI|no known conversion" }
15 };
16 
funct(Enum)17 int funct (Enum)
18 {
19   return 0;
20 }
21 
main()22 int main()
23 {
24   Enum e = enumerator1;
25   Struct s;
26   int x = funct(e+1);// { dg-error "invalid" }
27   int y = s.getI(e+1);// { dg-error "invalid" }
28   return x+y;
29 }
30