Fixed false positive when noreturn function is defined (#5601)