Skip to content

Commit 61cd6ca

Browse files
committed
Consistently exclude macro generated statements
1 parent efa556c commit 61cd6ca

File tree

1 file changed

+1
-1
lines changed
  • cpp/common/src/codingstandards/cpp/rules/deadcode

1 file changed

+1
-1
lines changed

cpp/common/src/codingstandards/cpp/rules/deadcode/DeadCode.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class DeadStmtInstance extends Stmt {
115115
// Exclude compiler generated statements
116116
not this.isCompilerGenerated() and
117117
// Exclude code fully generated by macros, because the code may be "live" in other expansions
118-
not this.isInMacroExpansion() and
118+
isNotWithinMacroExpansion(this) and
119119
// MISRA defines dead code as an "_executed_ statement whose removal would not affect the program
120120
// output". We therefore exclude unreachable statements as they are, by definition, not executed.
121121
not this.getBasicBlock() = any(UnreachableBasicBlock ubb).getABasicBlock()

0 commit comments

Comments
 (0)