Use isa<> instead of dyn_cast<> with unused value