Skip to content

Commit 79569b6

Browse files
committed
Rule 2.4: Exclude template parameters
1 parent 04c8ba2 commit 79569b6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

c/misra/src/rules/RULE-2-4/UnusedTagDeclaration.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,7 @@ where
2929
// expansions of the same macro.
3030
// Note: due to a bug in the CodeQL CLI version 2.9.4, this will currently have no effect, because
3131
// `isInMacroExpansion` is broken for `UserType`s.
32-
not s.isInMacroExpansion()
32+
not s.isInMacroExpansion() and
33+
// Exclude template parameters, in case this is run on C++ code.
34+
not s instanceof TemplateParameter
3335
select s, "struct " + s.getName() + " has an unused tag."

0 commit comments

Comments
 (0)