145
|
1 // PR c++/92032 - DR 1601: Promotion of enumeration with fixed underlying type.
|
|
2 // { dg-do compile { target c++11 } }
|
|
3
|
|
4 enum E1 : long { e1 };
|
|
5 enum E2 : short { e2 };
|
|
6
|
|
7 int f1(short);
|
|
8 void f1(int);
|
|
9
|
|
10 void f2(int);
|
|
11 int f2(short);
|
|
12
|
|
13 void f3(int);
|
|
14 int f3(long);
|
|
15
|
|
16 int f4(short);
|
|
17 void f4(long);
|
|
18
|
|
19 int f5(int);
|
|
20 void f5(long);
|
|
21
|
|
22 int f6(unsigned int); // { dg-message "candidate" }
|
|
23 void f6(long); // { dg-message "candidate" }
|
|
24
|
|
25 void
|
|
26 fn ()
|
|
27 {
|
|
28 int r = 0;
|
|
29 r += f1 (e2);
|
|
30 r += f2 (e2);
|
|
31 r += f3 (e1);
|
|
32 r += f4 (e2);
|
|
33 r += f5 (e2);
|
|
34 r += f6 (e2); // { dg-error "ambiguous" }
|
|
35 }
|