blob: fb23eda5bb9dad62d13b43b5c0a8466d1e486db8 [file] [log] [blame]
Douglas Gregor0167f3c2010-07-14 23:14:12 +00001// RUN: %clang_cc1 -fsyntax-only %s 2>&1| FileCheck %s
2
Douglas Gregor0167f3c2010-07-14 23:14:12 +00003// Note that the error count below doesn't matter. We just want to
4// make sure that the parser doesn't crash.
Douglas Gregor9625e442011-05-21 22:16:50 +00005// CHECK: 14 errors
6
7// PR7511
Douglas Gregor0167f3c2010-07-14 23:14:12 +00008template<a>
9struct int_;
10
11template<a>
12template<int,typename T1,typename>
13struct ac
14{
15 typedef T1 ae
16};
17
18template<class>struct aaa
19{
20 typedef ac<1,int,int>::ae ae
21};
22
23template<class>
24struct 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
55int a()
56{
57 state_machine<int> p;
58 p.ant(0);
59}
Douglas Gregor9625e442011-05-21 22:16:50 +000060
61// PR9974
62template <int> struct enable_if;
63template <class > struct remove_reference ;
64template <class _Tp> struct remove_reference<_Tp&> ;
65
66template <class > struct __tuple_like;
67
68template <class _Tp, class _Up, int = __tuple_like<typename remove_reference<_Tp>::type>::value>
69struct __tuple_convertible;
70
71struct pair
72{
73template<class _Tuple, int = enable_if<__tuple_convertible<_Tuple, pair>::value>::type>
74pair(_Tuple&& );
75};
76
77template <class> struct basic_ostream;
78
79template <int>
80void endl( ) ;
81
82extern basic_ostream<char> cout;
83
84int operator<<( basic_ostream<char> , pair ) ;
85
86void register_object_imp ( )
87{
88cout << endl<1>;
89}