Skip to content

Commit 0bed221

Browse files
authored
Merge pull request github#16201 from MathiasVP/add-consistency
C++: Add new AST consistency check
2 parents 1166645 + aac1070 commit 0bed221

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

cpp/ql/src/Metrics/Internal/ASTConsistency.ql

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,10 @@ predicate hasDuplicateFunctionEntryPointLocation(Function func) {
1414

1515
predicate hasDuplicateFunctionEntryPoint(Function func) { count(func.getEntryPoint()) > 1 }
1616

17-
select count(Function f | hasDuplicateFunctionEntryPoint(f) | f) as duplicateFunctionEntryPoint,
18-
count(Function f | hasDuplicateFunctionEntryPointLocation(f) | f) as duplicateFunctionEntryPointLocation
17+
predicate hasDuplicateDeclarationEntry(DeclStmt stmt, int i) {
18+
strictcount(stmt.getDeclarationEntry(i)) > 1
19+
}
20+
21+
select count(Function f | hasDuplicateFunctionEntryPoint(f)) as duplicateFunctionEntryPoint,
22+
count(Function f | hasDuplicateFunctionEntryPointLocation(f)) as duplicateFunctionEntryPointLocation,
23+
count(DeclStmt stmt, int i | hasDuplicateDeclarationEntry(stmt, i)) as duplicateDeclarationEntry

0 commit comments

Comments
 (0)