summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.benjamin/15756-2.C
blob: 77c4aca35ca77c14238bd9083b55579332c15abe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// { dg-do assemble  }
// { dg-options "-Wsign-promo" }
// 981203 bkoz
// g++/15756  test2
// this test may only be valid for 32bit targets at present

#include <limits.h>

enum e_i {
  vali
}
enum_int;

enum e_ui {
#if INT_MAX == 32767
  valui = 0xF234
#else
  valui = 0xF2345678
#endif
}
enum_uint;
 
int i;
unsigned int ui;

struct caracas {
  caracas(int);
  caracas(unsigned int);
  void foo();
};
 
int main ()
{
  caracas obj_ei  ( enum_int  ); // { dg-warning "" } 
  caracas obj_eui ( enum_uint ); // { dg-warning "" } 
  caracas obj_i  ( i  );
  caracas obj_ui ( ui );
  
  obj_ei.foo();
  obj_eui.foo();
  obj_i.foo();
  obj_ui.foo();
}