It's a bit more generic than that, because it will probably be flagged by the following code as well:
Code:
void func() {
    if(true) {
        cout << "Hello" << endl;
    } else {
        cout << "Not called" << endl;
    }
}