blob: 7ff41961399017ff9d8dc87e4c197cc7ef6a2c1e [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Andy Gibbs8e8fb3b2012-10-19 12:44:48 +00002// expected-no-diagnostics
Sebastian Redl599fe7c2009-05-27 19:21:29 +00003
4enum Enum { val = 1 };
5template <Enum v> struct C {
6 typedef C<v> Self;
7};
8template struct C<val>;
Douglas Gregor4912c342009-11-06 00:03:12 +00009
10template<typename T>
11struct get_size {
12 static const unsigned value = sizeof(T);
13};
14
15template<typename T>
16struct X0 {
17 enum {
18 Val1 = get_size<T>::value,
19 Val2,
20 SumOfValues = Val1 + Val2
21 };
22};
23
24X0<int> x0i;
Douglas Gregorceafbde2010-05-24 20:13:53 +000025
26namespace 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 McCall01b2e4e2010-12-06 05:26:58 +000034 bitfield + j;
Douglas Gregorceafbde2010-05-24 20:13:53 +000035 }
36 };
37}