C++: Exclude a cast to any integral type.

This commit is contained in:
Mathias Vorreiter Pedersen
2024-05-22 13:42:07 +01:00
parent 4b02f88089
commit 9907f0f827

View File

@@ -30,7 +30,8 @@ where
outlivesFullExpr(c) and
not c.isFromUninstantiatedTemplate(_) and
isUniquePointerDerefFunction(c.getTarget()) and
not c.getActualType() instanceof BoolType and
// Exclude cases where the pointer is implicitly converted to a non-pointer type
not c.getActualType() instanceof IntegralType and
isTemporary(c.getQualifier().getFullyConverted())
select c,
"The underlying unique pointer object is destroyed after the call to '" + c.getTarget() +