1 // Note: the run lines follow their respective tests, since line/column
2 // matter in this test.
3 
4 template<class T>
5 struct S {
6   template<class U>
SS7   S(T, U, U) {}
8 };
9 
main()10 int main() {
11   S<int>(42, 42, 42);
12   S<int>(42, 42, 42);
13   S<int> s(42, 42, 42);
14 
15   S<int>(42, 42, 42,);
16   S<int> z(42, 42, 42,);
17 
18   int(42);
19 }
20 
21 // RUN: c-index-test -code-completion-at=%s:11:10 %s | FileCheck -check-prefix=CHECK-CC1 %s
22 // CHECK-CC1: OverloadCandidate:{Text S}{LeftParen (}{CurrentParameter const S<int> &}{RightParen )} (1)
23 // CHECK-CC1: OverloadCandidate:{Text S}{LeftParen (}{CurrentParameter int}{Comma , }{Placeholder U}{Comma , }{Placeholder U}{RightParen )} (1)
24 // CHECK-CC1: Completion contexts:
25 // CHECK-CC1-NEXT: Any type
26 // CHECK-CC1-NEXT: Any value
27 // CHECK-CC1-NEXT: Enum tag
28 // CHECK-CC1-NEXT: Union tag
29 // CHECK-CC1-NEXT: Struct tag
30 // CHECK-CC1-NEXT: Class name
31 // CHECK-CC1-NEXT: Nested name specifier
32 // CHECK-CC1-NEXT: Objective-C interface
33 
34 // RUN: c-index-test -code-completion-at=%s:12:10 %s | FileCheck -check-prefix=CHECK-CC2 %s
35 // CHECK-CC2: OverloadCandidate:{Text S}{LeftParen (}{CurrentParameter const S<int> &}{RightParen )} (1)
36 // CHECK-CC2: OverloadCandidate:{Text S}{LeftParen (}{CurrentParameter int}{Comma , }{Placeholder U}{Comma , }{Placeholder U}{RightParen )} (1)
37 // CHECK-CC2: Completion contexts:
38 // CHECK-CC2-NEXT: Any type
39 // CHECK-CC2-NEXT: Any value
40 // CHECK-CC2-NEXT: Enum tag
41 // CHECK-CC2-NEXT: Union tag
42 // CHECK-CC2-NEXT: Struct tag
43 // CHECK-CC2-NEXT: Class name
44 // CHECK-CC2-NEXT: Nested name specifier
45 // CHECK-CC2-NEXT: Objective-C interface
46 
47 // RUN: c-index-test -code-completion-at=%s:12:13 %s | FileCheck -check-prefix=CHECK-CC3 %s
48 // CHECK-CC3: OverloadCandidate:{Text S}{LeftParen (}{Placeholder int}{Comma , }{CurrentParameter U}{Comma , }{Placeholder U}{RightParen )} (1)
49 // CHECK-CC3: Completion contexts:
50 // CHECK-CC3-NEXT: Any type
51 // CHECK-CC3-NEXT: Any value
52 // CHECK-CC3-NEXT: Enum tag
53 // CHECK-CC3-NEXT: Union tag
54 // CHECK-CC3-NEXT: Struct tag
55 // CHECK-CC3-NEXT: Class name
56 // CHECK-CC3-NEXT: Nested name specifier
57 // CHECK-CC3-NEXT: Objective-C interface
58 
59 // RUN: c-index-test -code-completion-at=%s:12:17 %s | FileCheck -check-prefix=CHECK-CC4 %s
60 // CHECK-CC4: OverloadCandidate:{Text S}{LeftParen (}{Placeholder int}{Comma , }{Placeholder int}{Comma , }{CurrentParameter int}{RightParen )} (1)
61 // CHECK-CC4: Completion contexts:
62 // CHECK-CC4-NEXT: Any type
63 // CHECK-CC4-NEXT: Any value
64 // CHECK-CC4-NEXT: Enum tag
65 // CHECK-CC4-NEXT: Union tag
66 // CHECK-CC4-NEXT: Struct tag
67 // CHECK-CC4-NEXT: Class name
68 // CHECK-CC4-NEXT: Nested name specifier
69 // CHECK-CC4-NEXT: Objective-C interface
70 
71 // RUN: c-index-test -code-completion-at=%s:13:12 %s | FileCheck -check-prefix=CHECK-CC5 %s
72 // CHECK-CC5: OverloadCandidate:{Text S}{LeftParen (}{CurrentParameter const S<int> &}{RightParen )} (1)
73 // CHECK-CC5: OverloadCandidate:{Text S}{LeftParen (}{CurrentParameter int}{Comma , }{Placeholder U}{Comma , }{Placeholder U}{RightParen )} (1)
74 // CHECK-CC5: Completion contexts:
75 // CHECK-CC5-NEXT: Any type
76 // CHECK-CC5-NEXT: Any value
77 // CHECK-CC5-NEXT: Enum tag
78 // CHECK-CC5-NEXT: Union tag
79 // CHECK-CC5-NEXT: Struct tag
80 // CHECK-CC5-NEXT: Class name
81 // CHECK-CC5-NEXT: Nested name specifier
82 // CHECK-CC5-NEXT: Objective-C interface
83 
84 // RUN: c-index-test -code-completion-at=%s:13:15 %s | FileCheck -check-prefix=CHECK-CC6 %s
85 // CHECK-CC6: OverloadCandidate:{Text S}{LeftParen (}{Placeholder int}{Comma , }{CurrentParameter U}{Comma , }{Placeholder U}{RightParen )} (1)
86 // CHECK-CC6: Completion contexts:
87 // CHECK-CC6-NEXT: Any type
88 // CHECK-CC6-NEXT: Any value
89 // CHECK-CC6-NEXT: Enum tag
90 // CHECK-CC6-NEXT: Union tag
91 // CHECK-CC6-NEXT: Struct tag
92 // CHECK-CC6-NEXT: Class name
93 // CHECK-CC6-NEXT: Nested name specifier
94 // CHECK-CC6-NEXT: Objective-C interface
95 
96 // RUN: c-index-test -code-completion-at=%s:13:19 %s | FileCheck -check-prefix=CHECK-CC7 %s
97 // CHECK-CC7: OverloadCandidate:{Text S}{LeftParen (}{Placeholder int}{Comma , }{Placeholder int}{Comma , }{CurrentParameter int}{RightParen )} (1)
98 // CHECK-CC7: Completion contexts:
99 // CHECK-CC7-NEXT: Any type
100 // CHECK-CC7-NEXT: Any value
101 // CHECK-CC7-NEXT: Enum tag
102 // CHECK-CC7-NEXT: Union tag
103 // CHECK-CC7-NEXT: Struct tag
104 // CHECK-CC7-NEXT: Class name
105 // CHECK-CC7-NEXT: Nested name specifier
106 // CHECK-CC7-NEXT: Objective-C interface
107 
108 // RUN: c-index-test -code-completion-at=%s:15:21 %s | FileCheck -check-prefix=CHECK-CC8 %s
109 // CHECK-CC8: Completion contexts:
110 // CHECK-CC8-NEXT: Any type
111 // CHECK-CC8-NEXT: Any value
112 // CHECK-CC8-NEXT: Enum tag
113 // CHECK-CC8-NEXT: Union tag
114 // CHECK-CC8-NEXT: Struct tag
115 // CHECK-CC8-NEXT: Class name
116 // CHECK-CC8-NEXT: Nested name specifier
117 // CHECK-CC8-NEXT: Objective-C interface
118 
119 // RUN: c-index-test -code-completion-at=%s:16:23 %s | FileCheck -check-prefix=CHECK-CC9 %s
120 // CHECK-CC9: Completion contexts:
121 // CHECK-CC9-NEXT: Any type
122 // CHECK-CC9-NEXT: Any value
123 // CHECK-CC9-NEXT: Enum tag
124 // CHECK-CC9-NEXT: Union tag
125 // CHECK-CC9-NEXT: Struct tag
126 // CHECK-CC9-NEXT: Class name
127 // CHECK-CC9-NEXT: Nested name specifier
128 // CHECK-CC9-NEXT: Objective-C interface
129 
130 // RUN: c-index-test -code-completion-at=%s:18:7 %s | FileCheck -check-prefix=CHECK-CC10 %s
131 // CHECK-CC10: FunctionDecl:{ResultType int}{TypedText main}{LeftParen (}{RightParen )} (12)
132 // CHECK-CC10: Completion contexts:
133 // CHECK-CC10-NEXT: Any type
134 // CHECK-CC10-NEXT: Any value
135 // CHECK-CC10-NEXT: Enum tag
136 // CHECK-CC10-NEXT: Union tag
137 // CHECK-CC10-NEXT: Struct tag
138 // CHECK-CC10-NEXT: Class name
139 // CHECK-CC10-NEXT: Nested name specifier
140 // CHECK-CC10-NEXT: Objective-C interface
141