Skip to content

Commit 8994a5a

Browse files
author
Robert Marsh
committed
C++: fix FP with ExprHasNoEffect in defaulted func
This is a workaround for an extractor issue where expressions in a defaulted function are not always marked as generated. I haven't yet been able to reproduce the issue in a test case.
1 parent 927d724 commit 8994a5a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cpp/ql/src/Likely Bugs/Likely Typos/ExprHasNoEffect.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ where // EQExprs are covered by CompareWhereAssignMeant.ql
7373
not baseCall(peivc) and
7474
not accessInInitOfForStmt(peivc) and
7575
not peivc.isCompilerGenerated() and
76+
not peivc.getEnclosingFunction().isDefaulted() and
7677
not exists(Macro m | peivc = m.getAnInvocation().getAnExpandedElement()) and
7778
not peivc.isFromTemplateInstantiation(_) and
7879
parent = peivc.getParent() and

0 commit comments

Comments
 (0)