I can't think of any game that I've played where the main character dies.
Off the top of my head...
Mass Effect 3, The Walking Dead, LA Noir, Assassin's Creed 3, Red Dead Redemtion and Fallout 3 (before the DLC expansion). It is a possible ending in inFamous 2, Dragon Age Origins, and Mass Effect 2.
So off the top of my head that is nine games, from this generation, in which the main character dies or can die in the ending.
Key word being "in the ending". I was trying to think of games where the MC dies towards the middle. --- Somebody tell me, tell me, tell me, when will I learn? I love it and I leave it and I watch it burn! Damn this wild young heart!