aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/warn/Wenum-compare-no-2.C
blob: fa7dda88a3ebb5c0cf5d7c717b94c911eb04fb0e (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
// PR c++/53524
// { dg-options "-Wno-enum-compare" }

template < typename > struct PointerLikeTypeTraits {
  enum { NumLowBitsAvailable };
};

class CodeGenInstruction;
class CodeGenInstAlias;

template < typename T>
struct PointerIntPair {
  enum { IntShift = T::NumLowBitsAvailable };
};

template < typename PT1, typename PT2 > struct PointerUnionUIntTraits {
  enum {
    PT1BitsAv = PointerLikeTypeTraits < PT1 >::NumLowBitsAvailable,
    PT2BitsAv = PointerLikeTypeTraits < PT2 >::NumLowBitsAvailable,
    NumLowBitsAvailable = 0 ? PT1BitsAv : PT2BitsAv
  };
};

template < typename PT1, typename PT2 > class PointerUnion {
  typedef PointerIntPair < PointerUnionUIntTraits < PT1, PT2 > > ValTy;
  ValTy Val;
};

struct ClassInfo {
  PointerUnion < CodeGenInstruction *, CodeGenInstAlias * > DefRec;
};