Skip to content

Commit 229d78d

Browse files
authored
[clang-doc] Use QualName in Markdown output
QualName will provide the more useful typename when the type is templated. Fixes #67549 Reviewers: petrhosek, PeterChou1 Reviewed By: petrhosek Pull Request: #119815
1 parent e113a72 commit 229d78d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

clang-tools-extra/clang-doc/MDGenerator.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -157,17 +157,17 @@ static void genMarkdown(const ClangDocContext &CDCtx, const FunctionInfo &I,
157157
for (const auto &N : I.Params) {
158158
if (!First)
159159
Stream << ", ";
160-
Stream << N.Type.Name + " " + N.Name;
160+
Stream << N.Type.QualName + " " + N.Name;
161161
First = false;
162162
}
163163
writeHeader(I.Name, 3, OS);
164164
std::string Access = getAccessSpelling(I.Access).str();
165165
if (Access != "")
166-
writeLine(genItalic(Access + " " + I.ReturnType.Type.Name + " " + I.Name +
167-
"(" + Stream.str() + ")"),
166+
writeLine(genItalic(Access + " " + I.ReturnType.Type.QualName + " " +
167+
I.Name + "(" + Stream.str() + ")"),
168168
OS);
169169
else
170-
writeLine(genItalic(I.ReturnType.Type.Name + " " + I.Name + "(" +
170+
writeLine(genItalic(I.ReturnType.Type.QualName + " " + I.Name + "(" +
171171
Stream.str() + ")"),
172172
OS);
173173
if (I.DefLoc)

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ tuple<int,int,bool> func_with_tuple_param(tuple<int,int,bool> t){ return t;}
150150
// YAML-NEXT: ...
151151

152152
// MD: ### func_with_tuple_param
153-
// MD: *tuple func_with_tuple_param(tuple t)*
153+
// MD: *tuple<int, int, _Bool> func_with_tuple_param(tuple<int, int, _Bool> t)*
154154
// MD: *Defined at {{.*}}templates.cpp#[[# @LINE - 44]]*
155155
// MD: A function with a tuple parameter
156156
// MD: **t** The input to func_with_tuple_param

0 commit comments

Comments
 (0)