blob: 68b4964816e4a41922ac6b9d16be85397b4454cf [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}