Skip to content

Commit 4075915

Browse files
[Sema] Migrate away from PointerUnion::dyn_cast (NFC) (llvm#124503)
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 U.first to be nonnull.
1 parent dc6411d commit 4075915

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/Sema/SemaDeclCXX.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9235,7 +9235,7 @@ struct SpecialMemberVisitor {
92359235
static SourceLocation getSubobjectLoc(Subobject Subobj) {
92369236
// FIXME: For an indirect virtual base, the direct base leading to
92379237
// the indirect virtual base would be a more useful choice.
9238-
if (auto *B = Subobj.dyn_cast<CXXBaseSpecifier*>())
9238+
if (auto *B = dyn_cast<CXXBaseSpecifier *>(Subobj))
92399239
return B->getBaseTypeLoc();
92409240
else
92419241
return cast<FieldDecl *>(Subobj)->getLocation();
@@ -17525,7 +17525,7 @@ DeclResult Sema::ActOnTemplatedFriendTag(
1752517525
unsigned FriendDeclDepth = TempParamLists.front()->getDepth();
1752617526
for (UnexpandedParameterPack &U : Unexpanded) {
1752717527
if (getDepthAndIndex(U).first >= FriendDeclDepth) {
17528-
auto *ND = U.first.dyn_cast<NamedDecl *>();
17528+
auto *ND = dyn_cast<NamedDecl *>(U.first);
1752917529
if (!ND)
1753017530
ND = cast<const TemplateTypeParmType *>(U.first)->getDecl();
1753117531
Diag(U.second, diag::friend_template_decl_malformed_pack_expansion)

0 commit comments

Comments
 (0)