summaryrefslogtreecommitdiff
path: root/test/SemaTemplate/enum-argument.cpp
blob: 7ff41961399017ff9d8dc87e4c197cc7ef6a2c1e (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
// RUN: %clang_cc1 -fsyntax-only -verify %s
// expected-no-diagnostics

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;
    }
  };
}