Home | History | Annotate | Download | only in SemaTemplate
      1 // RUN: %clang_cc1 -fsyntax-only %s
      2 
      3 // PR4607
      4 template <class T> struct X {};
      5 
      6 template <> struct X<char>
      7 {
      8   static char* g();
      9 };
     10 
     11 template <class T> struct X2 {};
     12 
     13 template <class U>
     14 struct X2<U*> {
     15   static void f() {
     16     X<U>::g();
     17   }
     18 };
     19 
     20 void a(char *a, char *b) {X2<char*>::f();}
     21 
     22 namespace 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 }
     41 
     42 // <rdar://problem/9169404>
     43 namespace 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 }
     51