summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.benjamin/15756-1.C
blob: 2bef3b0f12925c714ce20767e176755767a02046 (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
// { dg-do assemble  }
// { dg-options "-Wsign-promo" }
// 981203 bkoz
// g++/15756  test1

enum e_value { first = 0, next = 30 };

struct sanjuan {
  sanjuan(int value);
  sanjuan(unsigned value);
  friend sanjuan operator&(const sanjuan& x, const sanjuan& y);
  friend int operator!=(const sanjuan& x, const sanjuan& y);
};

extern void mod_enum(e_value*);
extern int a;

void foo(void) {
  e_value mod = first;
  mod_enum(&mod);
  if (mod != next)
    ++a;
}