Skip to content

Commit 325f74d

Browse files
committed
[clang][ssaf][NFC] Make test helper to return canonical decl
1 parent c25b2bf commit 325f74d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

clang/unittests/Analysis/Scalable/ASTEntityMappingTest.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ const DeclType *findDecl(ASTContext &Ctx, StringRef Name) {
2626
auto Matches = match(Matcher, Ctx);
2727
if (Matches.empty())
2828
return nullptr;
29-
return Matches[0].getNodeAs<DeclType>("decl");
29+
if (auto Result = Matches[0].getNodeAs<DeclType>("decl"))
30+
return dyn_cast<DeclType>(Result->getCanonicalDecl());
31+
return nullptr;
3032
}
3133

3234
TEST(ASTEntityMappingTest, FunctionDecl) {

0 commit comments

Comments
 (0)