blob: a93af5026d37fec46a86e4502c1faf67cbf0a644 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only %s
Douglas Gregor37d93e92009-08-02 23:24:31 +00002
3// PR4607
4template <class T> struct X {};
5
6template <> struct X<char>
7{
8 static char* g();
9};
10
11template <class T> struct X2 {};
12
13template <class U>
14struct X2<U*> {
15 static void f() {
16 X<U>::g();
17 }
18};
19
20void a(char *a, char *b) {X2<char*>::f();}
Douglas Gregor13c85772010-05-06 00:28:52 +000021
22namespace WonkyAccess {
23 template<typename T>
24 struct X {
25 int m;
26 };
27
28 template<typename U>
29 class Y;
30
31 template<typename U>
32 struct Y<U*> : X<U> { };
33
34 template<>
35 struct Y<float*> : X<float> { };
36
37 int f(Y<int*> y, Y<float*> y2) {
38 return y.m + y2.m;
39 }
40}
Douglas Gregorc7469372011-05-04 21:55:00 +000041
42// <rdar://problem/9169404>
43namespace rdar9169404 {
44 template<typename T, T N> struct X { };
45 template<bool C> struct X<bool, C> {
46 typedef int type;
47 };
48
49 X<bool, -1>::type value;
50}