Skip to content

Commit 7107f55

Browse files
committed
[clang] NFC: remove redundant dyn_cast
1 parent b2647ff commit 7107f55

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

clang/lib/AST/TemplateBase.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -515,19 +515,17 @@ void TemplateArgument::print(const PrintingPolicy &Policy, raw_ostream &Out,
515515
}
516516

517517
case Declaration: {
518-
NamedDecl *ND = getAsDecl();
518+
ValueDecl *VD = getAsDecl();
519519
if (getParamTypeForDecl()->isRecordType()) {
520-
if (auto *TPO = dyn_cast<TemplateParamObjectDecl>(ND)) {
520+
if (auto *TPO = dyn_cast<TemplateParamObjectDecl>(VD)) {
521521
TPO->getType().getUnqualifiedType().print(Out, Policy);
522522
TPO->printAsInit(Out, Policy);
523523
break;
524524
}
525525
}
526-
if (auto *VD = dyn_cast<ValueDecl>(ND)) {
527-
if (needsAmpersandOnTemplateArg(getParamTypeForDecl(), VD->getType()))
528-
Out << "&";
529-
}
530-
ND->printQualifiedName(Out);
526+
if (needsAmpersandOnTemplateArg(getParamTypeForDecl(), VD->getType()))
527+
Out << "&";
528+
VD->printQualifiedName(Out);
531529
break;
532530
}
533531

0 commit comments

Comments
 (0)