Skip to content

Commit e7dcbbc

Browse files
committed
fixup! [clang-tidy] Improved modernize-use-using by fixing a false-negative
Fixed crash in tests
1 parent f1d9574 commit e7dcbbc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clang-tools-extra/clang-tidy/modernize/UseUsingCheck.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ void UseUsingCheck::check(const MatchFinder::MatchResult &Result) {
6969

7070
if (!ParentDecl) {
7171
const auto *ParentDeclStmt = Result.Nodes.getNodeAs<DeclStmt>(DeclStmtName);
72-
ParentDecl = ParentDeclStmt->getSingleDecl();
72+
if (ParentDeclStmt)
73+
ParentDecl = ParentDeclStmt->getSingleDecl();
7374
}
7475

7576
if (!ParentDecl)

0 commit comments

Comments
 (0)