C/C++: Using UnspecifiedType instead of Type

This commit is contained in:
BACK Yonah
2022-02-04 19:12:15 +01:00
parent b2ca25abef
commit 21fdc53d62

View File

@@ -1,4 +1,3 @@
/**
* @name Useless Test
* @description A boolean condition that is guaranteed to never be evaluated should be deleted.
@@ -39,8 +38,8 @@ where
) and
eq.getRightOperand() instanceof Literal and
ne.getRightOperand() instanceof Literal and
eq.getLeftOperand().getFullyConverted().getType() =
ne.getLeftOperand().getFullyConverted().getType() and
eq.getLeftOperand().getFullyConverted().getUnspecifiedType() =
ne.getLeftOperand().getFullyConverted().getUnspecifiedType() and
nearestParent(eq) = nearestParent(ne) and
sameExpr(eq.getLeftOperand(), ne.getLeftOperand())
select ne, "Useless Test"