1 // Note: the run lines follow their respective tests, since line/column
2 // matter in this test.
3 
4 template<class T> void (&foo(T))(T);
5 template<class T> void (*bar(T))(T);
6 template<class T> void (&baz(T))(T, ...);
7 template<class T> void (*fiz(T))(T, ...);
8 
main()9 int main() {
10   foo(42)(42);
11   bar(42)(42);
12   baz(42)(42, 42, 42);
13   fiz(42)(42, 42, 42);
14 }
15 
16 // RUN: c-index-test -code-completion-at=%s:10:11 %s | FileCheck -check-prefix=CHECK-CC1 %s
17 // CHECK-CC1: OverloadCandidate:{ResultType void}{LeftParen (}{CurrentParameter int}{RightParen )} (1)
18 // CHECK-CC1: Completion contexts:
19 // CHECK-CC1-NEXT: Any type
20 // CHECK-CC1-NEXT: Any value
21 // CHECK-CC1-NEXT: Enum tag
22 // CHECK-CC1-NEXT: Union tag
23 // CHECK-CC1-NEXT: Struct tag
24 // CHECK-CC1-NEXT: Class name
25 // CHECK-CC1-NEXT: Nested name specifier
26 // CHECK-CC1-NEXT: Objective-C interface
27 
28 // RUN: c-index-test -code-completion-at=%s:11:11 %s | FileCheck -check-prefix=CHECK-CC2 %s
29 // CHECK-CC2: OverloadCandidate:{ResultType void}{LeftParen (}{CurrentParameter int}{RightParen )} (1)
30 // CHECK-CC2: Completion contexts:
31 // CHECK-CC2-NEXT: Any type
32 // CHECK-CC2-NEXT: Any value
33 // CHECK-CC2-NEXT: Enum tag
34 // CHECK-CC2-NEXT: Union tag
35 // CHECK-CC2-NEXT: Struct tag
36 // CHECK-CC2-NEXT: Class name
37 // CHECK-CC2-NEXT: Nested name specifier
38 // CHECK-CC2-NEXT: Objective-C interface
39 
40 // RUN: c-index-test -code-completion-at=%s:12:18 %s | FileCheck -check-prefix=CHECK-CC3 %s
41 // CHECK-CC3: OverloadCandidate:{ResultType void}{LeftParen (}{Placeholder int}{Optional {Comma , }{CurrentParameter ...}}{RightParen )} (1)
42 // CHECK-CC3: Completion contexts:
43 // CHECK-CC3-NEXT: Any type
44 // CHECK-CC3-NEXT: Any value
45 // CHECK-CC3-NEXT: Enum tag
46 // CHECK-CC3-NEXT: Union tag
47 // CHECK-CC3-NEXT: Struct tag
48 // CHECK-CC3-NEXT: Class name
49 // CHECK-CC3-NEXT: Nested name specifier
50 // CHECK-CC3-NEXT: Objective-C interface
51 
52 // RUN: c-index-test -code-completion-at=%s:13:18 %s | FileCheck -check-prefix=CHECK-CC4 %s
53 // CHECK-CC4: OverloadCandidate:{ResultType void}{LeftParen (}{Placeholder int}{Optional {Comma , }{CurrentParameter ...}}{RightParen )} (1)
54 // CHECK-CC4: Completion contexts:
55 // CHECK-CC4-NEXT: Any type
56 // CHECK-CC4-NEXT: Any value
57 // CHECK-CC4-NEXT: Enum tag
58 // CHECK-CC4-NEXT: Union tag
59 // CHECK-CC4-NEXT: Struct tag
60 // CHECK-CC4-NEXT: Class name
61 // CHECK-CC4-NEXT: Nested name specifier
62 // CHECK-CC4-NEXT: Objective-C interface
63