File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 8
8
9
9
#include " UseUsingCheck.h"
10
10
#include " clang/AST/ASTContext.h"
11
+ #include " clang/AST/DeclGroup.h"
11
12
#include " clang/Lex/Lexer.h"
12
13
13
14
using namespace clang ::ast_matchers;
@@ -69,8 +70,14 @@ void UseUsingCheck::check(const MatchFinder::MatchResult &Result) {
69
70
70
71
if (!ParentDecl) {
71
72
const auto *ParentDeclStmt = Result.Nodes .getNodeAs <DeclStmt>(DeclStmtName);
72
- if (ParentDeclStmt)
73
- ParentDecl = ParentDeclStmt->getSingleDecl ();
73
+ if (ParentDeclStmt) {
74
+ if (ParentDeclStmt->isSingleDecl ())
75
+ ParentDecl = ParentDeclStmt->getSingleDecl ();
76
+ else
77
+ ParentDecl =
78
+ ParentDeclStmt->getDeclGroup ().getDeclGroup ()
79
+ [ParentDeclStmt->getDeclGroup ().getDeclGroup ().size () - 1 ];
80
+ }
74
81
}
75
82
76
83
if (!ParentDecl)
You can’t perform that action at this time.
0 commit comments