18fbe78f6SDaniel Dunbar // RUN: %clang_cc1 -fsyntax-only -verify %s
2*a58017e5SElizabeth Andrews // expected-no-diagnostics
3eed3d4c7SSebastian Redl 
4eed3d4c7SSebastian Redl enum Enum { val = 1 };
5eed3d4c7SSebastian Redl template <Enum v> struct C {
6eed3d4c7SSebastian Redl   typedef C<v> Self;
7eed3d4c7SSebastian Redl };
8eed3d4c7SSebastian Redl template struct C<val>;
9b2186fe2SDouglas Gregor 
10b2186fe2SDouglas Gregor template<typename T>
11b2186fe2SDouglas Gregor struct get_size {
12b2186fe2SDouglas Gregor   static const unsigned value = sizeof(T);
13b2186fe2SDouglas Gregor };
14b2186fe2SDouglas Gregor 
15b2186fe2SDouglas Gregor template<typename T>
16b2186fe2SDouglas Gregor struct X0 {
17b2186fe2SDouglas Gregor   enum {
18b2186fe2SDouglas Gregor     Val1 = get_size<T>::value,
19b2186fe2SDouglas Gregor     Val2,
20b2186fe2SDouglas Gregor     SumOfValues = Val1 + Val2
21b2186fe2SDouglas Gregor   };
22b2186fe2SDouglas Gregor };
23b2186fe2SDouglas Gregor 
24b2186fe2SDouglas Gregor X0<int> x0i;
25e05d3cb7SDouglas Gregor 
26e05d3cb7SDouglas Gregor namespace rdar8020920 {
27e05d3cb7SDouglas Gregor   template<typename T>
28e05d3cb7SDouglas Gregor   struct X {
29e05d3cb7SDouglas Gregor     enum { e0 = 32 };
30e05d3cb7SDouglas Gregor 
31e05d3cb7SDouglas Gregor     unsigned long long bitfield : e0;
32e05d3cb7SDouglas Gregor 
frdar8020920::X33e05d3cb7SDouglas Gregor     void f(int j) {
34*a58017e5SElizabeth Andrews       bitfield + j;
35e05d3cb7SDouglas Gregor     }
36e05d3cb7SDouglas Gregor   };
37e05d3cb7SDouglas Gregor }
38