Skip to content

Commit db0887d

Browse files
committed
[clang][Index] Use canonical function parameter types in USRs
1 parent ee49cda commit db0887d

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
@@ -265,10 +265,13 @@ void USRGenerator::VisitFunctionDecl(const FunctionDecl *D) {
265265
Out << '>';
266266
}
267267

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

0 commit comments

Comments
 (0)