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