summaryrefslogtreecommitdiff
path: root/clang/test/SemaTemplate/enum-argument.cpp
blob: 7d237570678f23409bcb6c1382483039eb863e0a (about) (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
// RUN: %clang_cc1 -fsyntax-only -verify %s

enum Enum { val = 1 };
template <Enum v> struct C {
  typedef C<v> Self;
};
template struct C<val>;

template<typename T>
struct get_size {
  static const unsigned value = sizeof(T);
};

template<typename T>
struct X0 {
  enum {
    Val1 = get_size<T>::value,
    Val2,
    SumOfValues = Val1 + Val2
  };
};

X0<int> x0i;

namespace rdar8020920 {
  template<typename T>
  struct X {
    enum { e0 = 32 };

    unsigned long long bitfield : e0;

    void f(int j) {
      bitfield + j;
    }
  };
}