Hi, this code produces false positive warning
(style) Finding the same expression in both branches of ternary operator is suspicious as the same code is executed regardless of the condition.
int* f(void *p_memory)
{
return p_memory ? new (p_memory) int : new int; //< Same expression in both branches of ternary operator
}
I am using 2.14.1 version
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, this code produces false positive warning
(style) Finding the same expression in both branches of ternary operator is suspicious as the same code is executed regardless of the condition.
I am using 2.14.1 version
Placement new is not handled well, see e.g. https://trac.cppcheck.net/ticket/10934