1 // Note: the run lines follow their respective tests, since line/column numbers
2 // matter in this test.
20 // Check that implicit instantiations of class templates and members pick up
21 // comments from class templates and specializations.
52 typedef T3
<double> T12
;
55 void test_CC2_CC3_CC4() {
63 template<typename T
, typename U
>
67 /// This is T100<int, T>.
96 typedef T100
<double, T
> T109
;
98 typedef T100
<double, double> T110
;
101 void test_CC5_CC6_CC7() {
102 T100
<int, long>::T101();
103 T100
<int, long> t100
;
105 T100
<int, long>::T105 t105
;
108 // RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:17:1 %s | FileCheck -check-prefix=CHECK-CC1 %s
109 // CHECK-CC1: FunctionTemplate:{ResultType void}{TypedText T1}{{.*}}(brief comment: This is T1.)
110 // CHECK-CC1: FunctionTemplate:{ResultType void}{TypedText T2}{{.*}}(brief comment: This is T2.)
112 // RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:56:12 %s | FileCheck -check-prefix=CHECK-CC2 %s
113 // CHECK-CC2: CXXMethod:{ResultType void}{TypedText T4}{{.*}}(brief comment: This is T4.)
114 // CHECK-CC2: VarDecl:{ResultType int}{TypedText T5}{{.*}}(brief comment: This is T5.)
116 // RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:58:6 %s | FileCheck -check-prefix=CHECK-CC3 %s
117 // CHECK-CC3: FunctionTemplate:{ResultType void}{TypedText T11}{{.*}}(brief comment: This is T11.)
118 // CHECK-CC3: CXXMethod:{ResultType void}{TypedText T6}{{.*}}(brief comment: This is T6.)
119 // CHECK-CC3: FieldDecl:{ResultType int}{TypedText T7}{{.*}}(brief comment: This is T7.)
121 // RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:59:12 %s | FileCheck -check-prefix=CHECK-CC4 %s
122 // CHECK-CC4: EnumConstantDecl:{ResultType T3<int>::T9}{TypedText T10}{{.*}}(brief comment: This is T10.)
123 // FIXME: after we implement propagating comments through typedefs, this
124 // typedef for implicit instantiation should pick up the documentation
125 // comment from class template.
126 // CHECK-CC4: TypedefDecl:{TypedText T12}
127 // CHECK-CC4-SHOULD-BE: TypedefDecl:{TypedText T12}{{.*}}(brief comment: This is T3.)
128 // CHECK-CC4: ClassDecl:{TypedText T8}{{.*}}(brief comment: This is T8.)
129 // CHECK-CC4: EnumDecl:{TypedText T9}{{.*}}(brief comment: This is T9.)
131 // RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:102:20 %s | FileCheck -check-prefix=CHECK-CC5 %s
132 // CHECK-CC5: CXXMethod:{ResultType void}{TypedText T101}{{.*}}(brief comment: This is T101.)
133 // CHECK-CC5: VarDecl:{ResultType int}{TypedText T102}{{.*}}(brief comment: This is T102.)
135 // RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:104:8 %s | FileCheck -check-prefix=CHECK-CC6 %s
136 // CHECK-CC6: CXXMethod:{ResultType void}{TypedText T103}{{.*}}(brief comment: This is T103.)
137 // CHECK-CC6: FieldDecl:{ResultType int}{TypedText T104}{{.*}}(brief comment: This is T104.)
138 // CHECK-CC6: FunctionTemplate:{ResultType void}{TypedText T108}{{.*}}(brief comment: This is T108.)
140 // RUN: env CINDEXTEST_COMPLETION_BRIEF_COMMENTS=1 c-index-test -code-completion-at=%s:105:20 %s | FileCheck -check-prefix=CHECK-CC7 %s
141 // CHECK-CC7: ClassDecl:{TypedText T105}{{.*}}(brief comment: This is T105.)
142 // CHECK-CC7: EnumDecl:{TypedText T106}{{.*}}(brief comment: This is T106.)
143 // CHECK-CC7: EnumConstantDecl:{ResultType T100<int, long>::T106}{TypedText T107}{{.*}}(brief comment: This is T107.)
144 // FIXME: after we implement propagating comments through typedefs, these two
145 // typedefs for implicit instantiations should pick up the documentation
146 // comment from class template.
147 // CHECK-CC7: TypedefDecl:{TypedText T109}
148 // CHECK-CC7: TypedefDecl:{TypedText T110}
149 // CHECK-CC7-SHOULD-BE: TypedefDecl:{TypedText T109}{{.*}}(brief comment: This is T100.)
150 // CHECK-CC7-SHOULD-BE: TypedefDecl:{TypedText T110}{{.*}}(brief comment: This is T100.)