1 // RUN: %clang_cc1 -fsyntax-only %s 2>&1| FileCheck %s 2 3 // Note that the error count below doesn't matter. We just want to 4 // make sure that the parser doesn't crash. 5 // CHECK: 14 errors 6 7 // PR7511 8 template<a> 9 struct int_; 10 11 template<a> 12 template<int,typename T1,typename> 13 struct ac 14 { 15 typedef T1 ae 16 }; 17 18 template<class>struct aaa 19 { 20 typedef ac<1,int,int>::ae ae 21 }; 22 23 template<class> 24 struct state_machine 25 { 26 typedef aaa<int>::ae aaa; 27 int start() 28 { 29 ant(0); 30 } 31 32 template<class> 33 struct region_processing_helper 34 { 35 template<class,int=0> 36 struct In; 37 38 template<int my> 39 struct In<a::int_<aaa::a>,my>; 40 41 template<class Event> 42 int process(Event) 43 { 44 In<a::int_<0> > a; 45 } 46 } 47 template<class Event> 48 int ant(Event) 49 { 50 region_processing_helper<int>* helper; 51 helper->process(0) 52 } 53 }; 54 55 int a() 56 { 57 state_machine<int> p; 58 p.ant(0); 59 } 60 61 // PR9974 62 template <int> struct enable_if; 63 template <class > struct remove_reference ; 64 template <class _Tp> struct remove_reference<_Tp&> ; 65 66 template <class > struct __tuple_like; 67 68 template <class _Tp, class _Up, int = __tuple_like<typename remove_reference<_Tp>::type>::value> 69 struct __tuple_convertible; 70 71 struct pair 72 { 73 template<class _Tuple, int = enable_if<__tuple_convertible<_Tuple, pair>::value>::type> 74 pair(_Tuple&& ); 75 }; 76 77 template <class> struct basic_ostream; 78 79 template <int> 80 void endl( ) ; 81 82 extern basic_ostream<char> cout; 83 84 int operator<<( basic_ostream<char> , pair ) ; 85 86 void register_object_imp ( ) 87 { 88 cout << endl<1>; 89 } 90