1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
2 | // expected-no-diagnostics |
3 | |
4 | // PR5311 |
5 | template<typename T> |
6 | class StringSwitch { |
7 | public: |
8 | template<unsigned N> |
9 | void Case(const char (&S)[N], const int & Value) { |
10 | } |
11 | }; |
12 | |
13 | void test_stringswitch(int argc, char *argv[]) { |
14 | (void)StringSwitch<int>(); |
15 | } |
16 | |
17 | namespace PR6986 { |
18 | template<class Class,typename Type,Type Class::*> |
19 | struct non_const_member_base |
20 | { |
21 | }; |
22 | |
23 | template<class Class,typename Type,Type Class::*PtrToMember> |
24 | struct member: non_const_member_base<Class,Type,PtrToMember> |
25 | { |
26 | }; |
27 | |
28 | struct test_class |
29 | { |
30 | int int_member; |
31 | }; |
32 | typedef member< test_class,const int,&test_class::int_member > ckey_m; |
33 | void test() |
34 | { |
35 | ckey_m m; |
36 | } |
37 | } |
38 | |
39 | namespace rdar8980215 { |
40 | enum E { E1, E2, E3 }; |
41 | |
42 | template<typename T, E e = E2> |
43 | struct X0 { |
44 | X0() {} |
45 | template<typename U> X0(const X0<U, e> &); |
46 | }; |
47 | |
48 | template<typename T> |
49 | struct X1 : X0<T> { |
50 | X1() {} |
51 | template<typename U> X1(const X1<U> &x) : X0<T>(x) { } |
52 | }; |
53 | |
54 | X1<int> x1i; |
55 | X1<float> x1f(x1i); |
56 | } |
57 | |