Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Sebastian Redl | 599fe7c | 2009-05-27 19:21:29 +0000 | [diff] [blame] | 2 | |
| 3 | enum Enum { val = 1 }; |
| 4 | template <Enum v> struct C { |
| 5 | typedef C<v> Self; |
| 6 | }; |
| 7 | template struct C<val>; |
Douglas Gregor | 4912c34 | 2009-11-06 00:03:12 +0000 | [diff] [blame] | 8 | |
| 9 | template<typename T> |
| 10 | struct get_size { |
| 11 | static const unsigned value = sizeof(T); |
| 12 | }; |
| 13 | |
| 14 | template<typename T> |
| 15 | struct X0 { |
| 16 | enum { |
| 17 | Val1 = get_size<T>::value, |
| 18 | Val2, |
| 19 | SumOfValues = Val1 + Val2 |
| 20 | }; |
| 21 | }; |
| 22 | |
| 23 | X0<int> x0i; |
Douglas Gregor | ceafbde | 2010-05-24 20:13:53 +0000 | [diff] [blame] | 24 | |
| 25 | namespace rdar8020920 { |
| 26 | template<typename T> |
| 27 | struct X { |
| 28 | enum { e0 = 32 }; |
| 29 | |
| 30 | unsigned long long bitfield : e0; |
| 31 | |
| 32 | void f(int j) { |
John McCall | 01b2e4e | 2010-12-06 05:26:58 +0000 | [diff] [blame] | 33 | bitfield + j; |
Douglas Gregor | ceafbde | 2010-05-24 20:13:53 +0000 | [diff] [blame] | 34 | } |
| 35 | }; |
| 36 | } |