Skip to content

Commit 4a0d485

Browse files
authored
[clang-doc] Add definition information to class templates (llvm#169109)
1 parent f5e228b commit 4a0d485

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
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
@@ -140,6 +140,7 @@
140140
<section class="hero section-container">
141141
<div class="hero__title">
142142
<h1 class="hero__title-large">{{TagType}} {{Name}}</h1>
143+
<p>Defined at line {{Location.LineNumber}} of file {{Location.Filename}}</p>
143144
{{#Description}}
144145
<div class="hero__subtitle">
145146
{{>Comments}}

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858

5959
// COM: FIXME: Add global functions to the namespace template
6060
// COM: FIXME: Add namespaces to the namespace template
61-
// COM: FIXME: Add class definition location to class template
6261

6362
// Anonymous Namespace
6463
namespace {
@@ -70,7 +69,7 @@ void anonFunction() {}
7069
class AnonClass {};
7170
// MD-ANON-CLASS-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp#[[@LINE-1]]*
7271
// 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>
72+
// MUSTACHE-ANON-CLASS-LINE: <p>Defined at line [[@LINE-3]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
7473

7574
// MD-ANON-CLASS: # class AnonClass
7675
// HTML-ANON-CLASS: <h1>class AnonClass</h1>
@@ -117,7 +116,7 @@ void functionInPrimaryNamespace() {}
117116
class ClassInPrimaryNamespace {};
118117
// MD-PRIMARY-CLASS-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp#[[@LINE-1]]*
119118
// 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>
119+
// MUSTACHE-PRIMARY-CLASS-LINE: <p>Defined at line [[@LINE-3]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
121120

122121
// MD-PRIMARY-CLASS: # class ClassInPrimaryNamespace
123122
// MD-PRIMARY-CLASS: Class in PrimaryNamespace
@@ -139,7 +138,7 @@ void functionInNestedNamespace() {}
139138
class ClassInNestedNamespace {};
140139
// MD-NESTED-CLASS-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp#[[@LINE-1]]*
141140
// 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>
141+
// MUSTACHE-NESTED-CLASS-LINE: <p>Defined at line [[@LINE-3]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
143142

144143
// MD-NESTED-CLASS: # class ClassInNestedNamespace
145144
// MD-NESTED-CLASS: Class in NestedNamespace
@@ -233,7 +232,7 @@ void functionInAnotherNamespace() {}
233232
class ClassInAnotherNamespace {};
234233
// MD-ANOTHER-CLASS-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp#[[@LINE-1]]*
235234
// 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>
235+
// MUSTACHE-ANOTHER-CLASS-LINE: <p>Defined at line [[@LINE-3]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
237236

238237
// MD-ANOTHER-CLASS: # class ClassInAnotherNamespace
239238
// MD-ANOTHER-CLASS: Class in AnotherNamespace

0 commit comments

Comments
 (0)