Skip to content

Commit 21fdc53

Browse files
committed
C/C++: Using UnspecifiedType instead of Type
1 parent b2ca25a commit 21fdc53

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

cpp/ql/src/experimental/Best Practices/UselessTest.ql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/**
32
* @name Useless Test
43
* @description A boolean condition that is guaranteed to never be evaluated should be deleted.
@@ -39,8 +38,8 @@ where
3938
) and
4039
eq.getRightOperand() instanceof Literal and
4140
ne.getRightOperand() instanceof Literal and
42-
eq.getLeftOperand().getFullyConverted().getType() =
43-
ne.getLeftOperand().getFullyConverted().getType() and
41+
eq.getLeftOperand().getFullyConverted().getUnspecifiedType() =
42+
ne.getLeftOperand().getFullyConverted().getUnspecifiedType() and
4443
nearestParent(eq) = nearestParent(ne) and
4544
sameExpr(eq.getLeftOperand(), ne.getLeftOperand())
4645
select ne, "Useless Test"

0 commit comments

Comments
 (0)