Skip to content

Commit dc51cf9

Browse files
committed
[clang-doc] Add definition information to class templates
1 parent 79f518f commit dc51cf9

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

clang-tools-extra/clang-doc/assets/class-template.mustache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@
128128
<section class="hero section-container">
129129
<div class="hero__title">
130130
<h1 class="hero__title-large">{{TagType}} {{Name}}</h1>
131+
<p>Defined at line {{Location.LineNumber}} of file {{Location.Filename}}</p>
131132
{{#Description}}
132133
<div class="hero__subtitle">
133134
{{>Comments}}

clang-tools-extra/test/clang-doc/namespace.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void anonFunction() {}
7070
class AnonClass {};
7171
// MD-ANON-CLASS-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp#[[@LINE-1]]*
7272
// HTML-ANON-CLASS-LINE: <p>Defined at line [[@LINE-2]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
73-
// MUSTACHE-ANON-CLASS-LINE-NOT: <p>Defined at line [[@LINE-3]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
73+
// MUSTACHE-ANON-CLASS-LINE: <p>Defined at line [[@LINE-3]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
7474

7575
// MD-ANON-CLASS: # class AnonClass
7676
// HTML-ANON-CLASS: <h1>class AnonClass</h1>
@@ -117,7 +117,7 @@ void functionInPrimaryNamespace() {}
117117
class ClassInPrimaryNamespace {};
118118
// MD-PRIMARY-CLASS-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp#[[@LINE-1]]*
119119
// HTML-PRIMARY-CLASS-LINE: <p>Defined at line [[@LINE-2]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
120-
// MUSTACHE-PRIMARY-CLASS-LINE-NOT: <p>Defined at line [[@LINE-3]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
120+
// MUSTACHE-PRIMARY-CLASS-LINE: <p>Defined at line [[@LINE-3]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
121121

122122
// MD-PRIMARY-CLASS: # class ClassInPrimaryNamespace
123123
// MD-PRIMARY-CLASS: Class in PrimaryNamespace
@@ -139,7 +139,7 @@ void functionInNestedNamespace() {}
139139
class ClassInNestedNamespace {};
140140
// MD-NESTED-CLASS-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp#[[@LINE-1]]*
141141
// HTML-NESTED-CLASS-LINE: <p>Defined at line [[@LINE-2]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
142-
// MUSTACHE-NESTED-CLASS-LINE-NOT: <p>Defined at line [[@LINE-3]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
142+
// MUSTACHE-NESTED-CLASS-LINE: <p>Defined at line [[@LINE-3]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
143143

144144
// MD-NESTED-CLASS: # class ClassInNestedNamespace
145145
// MD-NESTED-CLASS: Class in NestedNamespace
@@ -233,7 +233,7 @@ void functionInAnotherNamespace() {}
233233
class ClassInAnotherNamespace {};
234234
// MD-ANOTHER-CLASS-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp#[[@LINE-1]]*
235235
// HTML-ANOTHER-CLASS-LINE: <p>Defined at line [[@LINE-2]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
236-
// MUSTACHE-ANOTHER-CLASS-LINE-NOT: <p>Defined at line [[@LINE-3]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
236+
// MUSTACHE-ANOTHER-CLASS-LINE: <p>Defined at line [[@LINE-3]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
237237

238238
// MD-ANOTHER-CLASS: # class ClassInAnotherNamespace
239239
// MD-ANOTHER-CLASS: Class in AnotherNamespace

0 commit comments

Comments
 (0)