One sort of case where death doesn't harm you is when you have a life that is not worth living. In such cases death might even be positively good for you. But now I want to discuss another type of case, wherein there is no "you" to be harmed. (This builds on my old posts on "animal ethics" and "soulless materialism".)
I propose that there are two broad classes of harms (or benefits):
(1) qualities of experience - e.g. pleasure and pain - that can affect any conscious being; and
(2) qualities of a life - e.g. global preference satisfaction - that only arise for beings with a personal identity, i.e. "persons" (in the philosophical sense that includes intelligent aliens, and excludes newborn babies or vegetative humans).
Death is a harm of the second type. It's not a bad experience, because it isn't any sort of experience at all. But the deprivation it involves might be seen as detrimental to one's life as a whole. (See also the old discussion here.) If I would prefer to live and experience pleasure, rather than die and not experience anything, then death is bad for me, for precisely this reason.
But what of creatures that, though conscious, lack any 'global preferences' or sense of self? Such creatures have no persisting identity over time. We might say that a chicken is the same physical object now as it was last week. But it is not the same mental being. There is no persisting chicken-mind that has interests over time. The fact that the chicken is conscious suffices to give it type-1 interests, so that inflicting pain on it would be bad. But it has no future-directed interests, so it is not harmed by a painless death.
One might object that the killed chicken is deprived of pleasant experiences. But that presupposes that the same chicken-mind would persist into the future, which I think is not the case. The mental chicken merely lives from moment to moment. If the physical chicken lived longer, then some new chicken-moments would get to experience life. But this is just the same as a new chicken being born. (The fact that the new mental life occurs in an old body is a fact of no moral significance.) In this sense, the lives of non-persons are replaceable. That is to say, there is no difference in value between:
(a) The one creature living for X amount of time and experiencing Y units of pleasure; versus
(b) Two creatures living consecutively, each for X/2 time and experiencing Y/2 units of pleasure.
It is good to have chicken-pleasure in the world. But it doesn't much matter which chickens have it. If some die and are replaced by others which go on to have just as pleasant an experience, this change makes no moral difference.
People are not replaceable in this sense, due to their persisting identities and future-regarding desires. They would be harmed by death. Moreover, each individual is unique, and thus 'irreplaceable' in the sense that any new person will be significantly different. The lives of people are distinct and distinguishable in a way that the lives of chickens are not. So when one person dies and is "replaced" with another, something is lost that has no analogue in cases of chicken-replacement.
One might object that considerations of mental 'personhood' count just as strongly against some humans (say infants or the severely mentally disabled) as against animals. Here I simply bite the bullet. If an infant has no persisting mental identity, then it is not harmed by its death either. (Though its parents might well be.)
Still, such judgments are dangerous, and open up grave potential for abuse (say if those in power decide to extend this judgment to include disfavoured minority groups!). So for indirect utilitarian reasons we might want to posit "human rights" that protect all humans without exception -- even those that aren't really persons -- because we don't want to risk miscategorization.
A final, somewhat disturbing, thought: imagine a 'baby farm' (where 'baby oil' comes from!), which grows test-tube babies in artificial wombs [so as to avoid any complications regarding the exploitation of women]. The babies have a pleasant enough experience, and are killed before developing any sense of identity. They then go on the BBQ, alongside the pork and chicken kebabs. Is there anything morally objectionable about this scenario?
My analysis suggests that there isn't. It's emotionally repugnant, I certainly agree with that. But it isn't clear whether there are solid reasons for thinking that anything bad is going on here. No-one is harmed in the scenario. (We might worry that the people involved would become psychologically twisted by it. That could provide indirect utilitarian reasons against such depravity, of course. But let us bracket such concerns by stipulating that there are no such unforeseen consequences. Their world is exactly like ours in every respect apart from the baby farm itself; it has no broader implications.) So we rationally must conclude that the baby farm is morally permissible. So much the worse for our moral intuitions, eh?