Skip to content

Commit 8022677

Browse files
committed
[clang][Index] Use canonical function parameter types in USRs
1 parent 7089c35 commit 8022677

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

clang/lib/Index/USRGeneration.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,13 @@ void USRGenerator::VisitFunctionDecl(const FunctionDecl *D) {
267267
Out << '>';
268268
}
269269

270+
QualType CanonicalType = D->getType().getCanonicalType();
270271
// Mangle in type information for the arguments.
271-
for (auto *PD : D->parameters()) {
272-
Out << '#';
273-
VisitType(PD->getType());
272+
if (const auto *FPT = CanonicalType->getAs<FunctionProtoType>()) {
273+
for (QualType PT : FPT->param_types()) {
274+
Out << '#';
275+
VisitType(PT);
276+
}
274277
}
275278
if (D->isVariadic())
276279
Out << '.';

0 commit comments

Comments
 (0)