Skip to content

Commit 04677ac

Browse files
committed
Use dyn_cast instead of dyn_cast_if_present
1 parent 912a8f0 commit 04677ac

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

clang/lib/Sema/SemaDecl.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13528,11 +13528,10 @@ bool Sema::GloballyUniqueObjectMightBeAccidentallyDuplicated(
1352813528

1352913529
// If the variable isn't directly annotated, check to see if it's a member
1353013530
// of an annotated class.
13531-
const VarDecl *VD = dyn_cast_if_present<VarDecl>(Target);
13531+
const VarDecl *VD = dyn_cast<VarDecl>(Target);
1353213532

1353313533
if (VD && VD->isStaticDataMember()) {
13534-
const CXXRecordDecl *Ctx =
13535-
dyn_cast_if_present<CXXRecordDecl>(VD->getDeclContext());
13534+
const CXXRecordDecl *Ctx = dyn_cast<CXXRecordDecl>(VD->getDeclContext());
1353613535
if (Ctx &&
1353713536
(Ctx->hasAttr<DLLExportAttr>() || Ctx->hasAttr<DLLImportAttr>()))
1353813537
return false;

0 commit comments

Comments
 (0)