1// RUN: rm -rf %t
2// RUN: mkdir %t
3// RUN: echo "" > %t/compile_flags.txt
4// RUN: cp "%s" "%t/test.cpp"
5// RUN: clang-doc --doxygen --executor=standalone -p %t %t/test.cpp -output=%t/docs
6// RUN: cat %t/docs/index.yaml | FileCheck %s --check-prefix=CHECK
7// RUN: rm -rf %t
8
9template<typename T, int U = 1>
10void function(T x) {}
11
12template<>
13void function<bool, 0>(bool x) {}
14
15template<class... T>
16void ParamPackFunction(T... args);
17
18// CHECK: ---
19// CHECK-NEXT: USR: '{{([0-9A-F]{40})}}'
20// CHECK-NEXT: ChildFunctions:
21// CHECK-NEXT: - USR: '{{([0-9A-F]{40})}}'
22// CHECK-NEXT: Name: 'function'
23// CHECK-NEXT: DefLocation:
24// CHECK-NEXT: LineNumber: 10
25// CHECK-NEXT: Filename: '{{.*}}'
26// CHECK-NEXT: Params:
27// CHECK-NEXT: - Type:
28// CHECK-NEXT: Name: 'T'
29// CHECK-NEXT: QualName: 'T'
30// CHECK-NEXT: Name: 'x'
31// CHECK-NEXT: ReturnType:
32// CHECK-NEXT: Type:
33// CHECK-NEXT: Name: 'void'
34// CHECK-NEXT: QualName: 'void'
35// CHECK-NEXT: Template:
36// CHECK-NEXT: Params:
37// CHECK-NEXT: - Contents: 'typename T'
38// CHECK-NEXT: - Contents: 'int U = 1'
39// CHECK-NEXT: - USR: '{{([0-9A-F]{40})}}'
40// CHECK-NEXT: Name: 'function'
41// CHECK-NEXT: DefLocation:
42// CHECK-NEXT: LineNumber: 12
43// CHECK-NEXT: Filename: '{{.*}}'
44// CHECK-NEXT: Params:
45// CHECK-NEXT: - Type:
46// CHECK-NEXT: Name: '_Bool'
47// CHECK-NEXT: QualName: '_Bool'
48// CHECK-NEXT: Name: 'x'
49// CHECK-NEXT: ReturnType:
50// CHECK-NEXT: Type:
51// CHECK-NEXT: Name: 'void'
52// CHECK-NEXT: QualName: 'void'
53// CHECK-NEXT: Template:
54// CHECK-NEXT: Specialization:
55// CHECK-NEXT: SpecializationOf: '{{([0-9A-F]{40})}}'
56// CHECK-NEXT: Params:
57// CHECK-NEXT: - Contents: 'bool'
58// CHECK-NEXT: - Contents: '0'
59// CHECK-NEXT: - USR: '{{([0-9A-F]{40})}}'
60// CHECK-NEXT: Name: 'ParamPackFunction'
61// CHECK-NEXT: Location:
62// CHECK-NEXT: - LineNumber: 16
63// CHECK-NEXT: Filename: '{{.*}}'
64// CHECK-NEXT: Params:
65// CHECK-NEXT: - Type:
66// CHECK-NEXT: Name: 'T...'
67// CHECK-NEXT: QualName: 'T...'
68// CHECK-NEXT: Name: 'args'
69// CHECK-NEXT: ReturnType:
70// CHECK-NEXT: Type:
71// CHECK-NEXT: Name: 'void'
72// CHECK-NEXT: QualName: 'void'
73// CHECK-NEXT: Template:
74// CHECK-NEXT: Params:
75// CHECK-NEXT: - Contents: 'class... T'
76// CHECK-NEXT: ...
77

source code of clang-tools-extra/test/clang-doc/templates.cpp