False positive fix for cpp/uninitialized-local

This commit is contained in:
Benjamin Rodes
2024-01-29 13:21:05 -05:00
parent aeae208dc3
commit 13cf555cee
3 changed files with 22 additions and 1 deletions

View File

@@ -532,4 +532,16 @@ int non_exhaustive_switch_2(State s) {
return y; // GOOD (y is not initialized when s = StateC, but if s = StateC we won't reach this point)
}
return 0;
}
class StaticMethodClass{
public:
static int get(){
return 1;
}
};
int static_method_false_positive(){
StaticMethodClass *t;
int i = t->get(); // GOOD: the `get` method is static and this is equivalent to StaticMethodClass::get()
}