C++: Address false positive results in template instantiations.

This commit is contained in:
Geoffrey White
2024-07-22 12:40:29 +01:00
parent 8262330e4d
commit b4fa23d731
3 changed files with 2 additions and 2 deletions

View File

@@ -232,6 +232,7 @@ predicate nullCheckInThrowingNew(NewOrNewArrayExpr newExpr, GuardCondition guard
from NewOrNewArrayExpr newExpr, Element element, string msg, string elementString
where
not newExpr.isFromUninstantiatedTemplate(_) and
not newExpr.isFromTemplateInstantiation(_) and
(
noThrowInTryBlock(newExpr, element) and
msg = "This allocation cannot throw. $@ is unnecessary." and