annotate clang/test/Index/complete-optional-params.cpp @ 206:f17a3b42b08b

Added tag before-12 for changeset b7591485f4cd
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 07 Jun 2021 21:25:57 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // Note: the run lines follow their respective tests, since line/column
anatofuz
parents:
diff changeset
2 // matter in this test.
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 void foo(int a = 42, int = 42);
anatofuz
parents:
diff changeset
5 void bar(int a, int b = 42, int c = 42);
anatofuz
parents:
diff changeset
6 void baz(int a = 42, ...);
anatofuz
parents:
diff changeset
7 struct S{ S(int a = 42, int = 42) {} };
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 class Bar1 { public: Bar1() {} }; class Bar2;
anatofuz
parents:
diff changeset
10 void foo_2(Bar1 b1 = Bar1(), Bar2 b2 = Bar2());
anatofuz
parents:
diff changeset
11
anatofuz
parents:
diff changeset
12 int main() {
anatofuz
parents:
diff changeset
13 foo(42, 42);
anatofuz
parents:
diff changeset
14 bar(42, 42, 42);
anatofuz
parents:
diff changeset
15 baz(42, 42, 42);
anatofuz
parents:
diff changeset
16 S s(42, 42);
anatofuz
parents:
diff changeset
17 foo_2();
anatofuz
parents:
diff changeset
18 }
anatofuz
parents:
diff changeset
19
anatofuz
parents:
diff changeset
20 // RUN: c-index-test -code-completion-at=%s:13:9 %s | FileCheck -check-prefix=CHECK-CC1 %s
anatofuz
parents:
diff changeset
21 // CHECK-CC1: OverloadCandidate:{ResultType void}{Text foo}{LeftParen (}{Optional {CurrentParameter int a = 42}{Optional {Comma , }{Placeholder int = 42}}}{RightParen )} (1)
anatofuz
parents:
diff changeset
22 // CHECK-CC1: Completion contexts:
anatofuz
parents:
diff changeset
23 // CHECK-CC1-NEXT: Any type
anatofuz
parents:
diff changeset
24 // CHECK-CC1-NEXT: Any value
anatofuz
parents:
diff changeset
25 // CHECK-CC1-NEXT: Enum tag
anatofuz
parents:
diff changeset
26 // CHECK-CC1-NEXT: Union tag
anatofuz
parents:
diff changeset
27 // CHECK-CC1-NEXT: Struct tag
anatofuz
parents:
diff changeset
28 // CHECK-CC1-NEXT: Class name
anatofuz
parents:
diff changeset
29 // CHECK-CC1-NEXT: Nested name specifier
anatofuz
parents:
diff changeset
30 // CHECK-CC1-NEXT: Objective-C interface
anatofuz
parents:
diff changeset
31
anatofuz
parents:
diff changeset
32 // RUN: c-index-test -code-completion-at=%s:14:9 %s | FileCheck -check-prefix=CHECK-CC2 %s
anatofuz
parents:
diff changeset
33 // CHECK-CC2: OverloadCandidate:{ResultType void}{Text bar}{LeftParen (}{CurrentParameter int a}{Optional {Comma , }{Placeholder int b = 42}{Optional {Comma , }{Placeholder int c = 42}}}{RightParen )} (1)
anatofuz
parents:
diff changeset
34 // CHECK-CC2: Completion contexts:
anatofuz
parents:
diff changeset
35 // CHECK-CC2-NEXT: Any type
anatofuz
parents:
diff changeset
36 // CHECK-CC2-NEXT: Any value
anatofuz
parents:
diff changeset
37 // CHECK-CC2-NEXT: Enum tag
anatofuz
parents:
diff changeset
38 // CHECK-CC2-NEXT: Union tag
anatofuz
parents:
diff changeset
39 // CHECK-CC2-NEXT: Struct tag
anatofuz
parents:
diff changeset
40 // CHECK-CC2-NEXT: Class name
anatofuz
parents:
diff changeset
41 // CHECK-CC2-NEXT: Nested name specifier
anatofuz
parents:
diff changeset
42 // CHECK-CC2-NEXT: Objective-C interface
anatofuz
parents:
diff changeset
43
anatofuz
parents:
diff changeset
44 // RUN: c-index-test -code-completion-at=%s:14:16 %s | FileCheck -check-prefix=CHECK-CC3 %s
anatofuz
parents:
diff changeset
45 // CHECK-CC3: OverloadCandidate:{ResultType void}{Text bar}{LeftParen (}{Placeholder int a}{Optional {Comma , }{Placeholder int b = 42}{Optional {Comma , }{CurrentParameter int c = 42}}}{RightParen )} (1)
anatofuz
parents:
diff changeset
46 // CHECK-CC3: Completion contexts:
anatofuz
parents:
diff changeset
47 // CHECK-CC3-NEXT: Any type
anatofuz
parents:
diff changeset
48 // CHECK-CC3-NEXT: Any value
anatofuz
parents:
diff changeset
49 // CHECK-CC3-NEXT: Enum tag
anatofuz
parents:
diff changeset
50 // CHECK-CC3-NEXT: Union tag
anatofuz
parents:
diff changeset
51 // CHECK-CC3-NEXT: Struct tag
anatofuz
parents:
diff changeset
52 // CHECK-CC3-NEXT: Class name
anatofuz
parents:
diff changeset
53 // CHECK-CC3-NEXT: Nested name specifier
anatofuz
parents:
diff changeset
54 // CHECK-CC3-NEXT: Objective-C interface
anatofuz
parents:
diff changeset
55
anatofuz
parents:
diff changeset
56 // RUN: c-index-test -code-completion-at=%s:15:16 %s | FileCheck -check-prefix=CHECK-CC4 %s
anatofuz
parents:
diff changeset
57 // CHECK-CC4: OverloadCandidate:{ResultType void}{Text baz}{LeftParen (}{Optional {Placeholder int a = 42}{Optional {Comma , }{CurrentParameter ...}}}{RightParen )} (1)
anatofuz
parents:
diff changeset
58 // CHECK-CC4: Completion contexts:
anatofuz
parents:
diff changeset
59 // CHECK-CC4-NEXT: Any type
anatofuz
parents:
diff changeset
60 // CHECK-CC4-NEXT: Any value
anatofuz
parents:
diff changeset
61 // CHECK-CC4-NEXT: Enum tag
anatofuz
parents:
diff changeset
62 // CHECK-CC4-NEXT: Union tag
anatofuz
parents:
diff changeset
63 // CHECK-CC4-NEXT: Struct tag
anatofuz
parents:
diff changeset
64 // CHECK-CC4-NEXT: Class name
anatofuz
parents:
diff changeset
65 // CHECK-CC4-NEXT: Nested name specifier
anatofuz
parents:
diff changeset
66 // CHECK-CC4-NEXT: Objective-C interface
anatofuz
parents:
diff changeset
67
anatofuz
parents:
diff changeset
68 // RUN: c-index-test -code-completion-at=%s:16:9 %s | FileCheck -check-prefix=CHECK-CC5 %s
anatofuz
parents:
diff changeset
69 // CHECK-CC5: OverloadCandidate:{Text S}{LeftParen (}{Optional {CurrentParameter int a = 42}{Optional {Comma , }{Placeholder int = 42}}}{RightParen )} (1)
anatofuz
parents:
diff changeset
70 // CHECK-CC5: OverloadCandidate:{Text S}{LeftParen (}{CurrentParameter const S &}{RightParen )} (1)
anatofuz
parents:
diff changeset
71 // CHECK-CC5: Completion contexts:
anatofuz
parents:
diff changeset
72 // CHECK-CC5-NEXT: Any type
anatofuz
parents:
diff changeset
73 // CHECK-CC5-NEXT: Any value
anatofuz
parents:
diff changeset
74 // CHECK-CC5-NEXT: Enum tag
anatofuz
parents:
diff changeset
75 // CHECK-CC5-NEXT: Union tag
anatofuz
parents:
diff changeset
76 // CHECK-CC5-NEXT: Struct tag
anatofuz
parents:
diff changeset
77 // CHECK-CC5-NEXT: Class name
anatofuz
parents:
diff changeset
78 // CHECK-CC5-NEXT: Nested name specifier
anatofuz
parents:
diff changeset
79 // CHECK-CC5-NEXT: Objective-C interface
anatofuz
parents:
diff changeset
80
anatofuz
parents:
diff changeset
81 // RUN: c-index-test -code-completion-at=%s:17:11 %s | FileCheck -check-prefix=CHECK-CC6 %s
anatofuz
parents:
diff changeset
82 // CHECK-CC6: FunctionDecl:{ResultType void}{TypedText foo_2}{LeftParen (}{Optional {Placeholder Bar1 b1 = Bar1()}{Optional {Comma , }{Placeholder Bar2 b2}}}{RightParen )} (50)
anatofuz
parents:
diff changeset
83 // CHECK-CC6: Completion contexts:
anatofuz
parents:
diff changeset
84 // CHECK-CC6-NEXT: Any type
anatofuz
parents:
diff changeset
85 // CHECK-CC6-NEXT: Any value
anatofuz
parents:
diff changeset
86 // CHECK-CC6-NEXT: Enum tag
anatofuz
parents:
diff changeset
87 // CHECK-CC6-NEXT: Union tag
anatofuz
parents:
diff changeset
88 // CHECK-CC6-NEXT: Struct tag
anatofuz
parents:
diff changeset
89 // CHECK-CC6-NEXT: Class name
anatofuz
parents:
diff changeset
90 // CHECK-CC6-NEXT: Nested name specifier
anatofuz
parents:
diff changeset
91 // CHECK-CC6-NEXT: Objective-C interface