CPP: Repair macro case.

This commit is contained in:
Geoffrey White
2018-11-08 10:01:07 +00:00
parent d6f27f0b2d
commit 5b09e11a52
3 changed files with 2 additions and 2 deletions

View File

@@ -99,6 +99,7 @@ where // EQExprs are covered by CompareWhereAssignMeant.ql
not peivc.(FunctionCall).getTarget().hasName("operator==") and
not accessInInitOfForStmt(peivc) and
not peivc.isCompilerGenerated() and
not exists(Macro m | peivc = m.getAnInvocation().getAnExpandedElement()) and
not peivc.isFromTemplateInstantiation(_) and
parent = peivc.getParent() and
not parent.isInMacroExpansion() and

View File

@@ -1,4 +1,3 @@
| macros.c:6:9:6:13 | param | This expression has no effect. | macros.c:6:9:6:13 | param | |
| preproc.c:89:2:89:4 | call to fn4 | This expression has no effect (because $@ has no external side effects). | preproc.c:33:5:33:7 | fn4 | fn4 |
| preproc.c:94:2:94:4 | call to fn9 | This expression has no effect (because $@ has no external side effects). | preproc.c:78:5:78:7 | fn9 | fn9 |
| template.cpp:19:3:19:3 | call to operator++ | This expression has no effect (because $@ has no external side effects). | template.cpp:9:10:9:19 | operator++ | operator++ |

View File

@@ -3,5 +3,5 @@
void test2(int param)
{
UNUSED(param); // GOOD [FALSE POSITIVE]
UNUSED(param); // GOOD
}