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