Skip to content

Commit a5159e2

Browse files
[AST] Migrate away from PointerUnion::dyn_cast (NFC) (#123890)
Note that PointerUnion::dyn_cast has been soft deprecated in PointerUnion.h: // FIXME: Replace the uses of is(), get() and dyn_cast() with // isa<T>, cast<T> and the llvm::dyn_cast<T> Literal migration would result in dyn_cast_if_present (see the definition of PointerUnion::dyn_cast), but this patch uses dyn_cast because we expect TemplateOrSpecialization to be nonnull.
1 parent 9decc24 commit a5159e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/AST/Decl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4003,7 +4003,7 @@ const IdentifierInfo *FunctionDecl::getLiteralIdentifier() const {
40034003
FunctionDecl::TemplatedKind FunctionDecl::getTemplatedKind() const {
40044004
if (TemplateOrSpecialization.isNull())
40054005
return TK_NonTemplate;
4006-
if (const auto *ND = TemplateOrSpecialization.dyn_cast<NamedDecl *>()) {
4006+
if (const auto *ND = dyn_cast<NamedDecl *>(TemplateOrSpecialization)) {
40074007
if (isa<FunctionDecl>(ND))
40084008
return TK_DependentNonTemplate;
40094009
assert(isa<FunctionTemplateDecl>(ND) &&

0 commit comments

Comments
 (0)