C++: Remove FPs in cpp/wrong-type-format-argument when string type is an error

This commit is contained in:
Calum Grant
2024-12-04 11:02:19 +00:00
parent 19424020c3
commit 28c5187a3c
2 changed files with 4 additions and 1 deletions

View File

@@ -171,6 +171,10 @@ where
not arg.isAffectedByMacro() and
not arg.isFromUninstantiatedTemplate(_) and
not actual.getUnspecifiedType() instanceof ErroneousType and
not (
expected instanceof PointerType and
actual.getUnspecifiedType().(PointerType).getBaseType() instanceof ErroneousType
) and
not arg.(Call).mayBeFromImplicitlyDeclaredFunction()
select arg,
"This format specifier for type '" + expected.getName() + "' does not match the argument type '" +

View File

@@ -1,2 +1 @@
| tests.c:7:18:7:18 | 1 | This format specifier for type 'char *' does not match the argument type 'int'. |
| tests.c:11:18:11:20 | str | This format specifier for type 'char *' does not match the argument type '<error-type> *'. |