Home | History | Annotate | Download | only in SemaTemplate
      1 // RUN: %clang_cc1 -fsyntax-only -verify %s
      2 
      3 // PR5908
      4 template <typename Iterator>
      5 void Test(Iterator it) {
      6   *(it += 1);
      7 }
      8 
      9 namespace PR6045 {
     10   template<unsigned int r>
     11   class A
     12   {
     13     static const unsigned int member = r;
     14     void f();
     15   };
     16 
     17   template<unsigned int r>
     18   const unsigned int A<r>::member;
     19 
     20   template<unsigned int r>
     21   void A<r>::f()
     22   {
     23     unsigned k;
     24     (void)(k % member);
     25   }
     26 }
     27 
     28 namespace PR7198 {
     29   struct A
     30   {
     31     ~A() { }
     32   };
     33 
     34   template<typename T>
     35   struct B {
     36     struct C : A {};
     37     void f()
     38     {
     39       C c = C();
     40     }
     41   };
     42 }
     43 
     44 namespace PR7724 {
     45   template<typename OT> int myMethod()
     46   { return 2 && sizeof(OT); }
     47 }
     48 
     49 namespace test4 {
     50   template <typename T> T *addressof(T &v) {
     51     return reinterpret_cast<T*>(
     52              &const_cast<char&>(reinterpret_cast<const volatile char &>(v)));
     53   }
     54 }
     55 
     56 namespace test5 {
     57   template <typename T> class chained_map {
     58     int k;
     59     void lookup() const {
     60       int &v = (int &)k;
     61     }
     62   };
     63 }
     64 
     65 namespace PR8795 {
     66   template <class _CharT> int test(_CharT t)
     67   {
     68     int data [] = {
     69       sizeof(_CharT) > sizeof(char)
     70     };
     71     return data[0];
     72   }
     73 }
     74