It has just been brought to my attention that the 20th Amendment provides that if the president-elect (which in the Constitution means the person elected president by the Electoral College or, if no majority there, by the House) has died, the VP-elect would become president at noon on January 20. That means that the VP-elect would take the presidential oath directly without first taking the vice-presidential oath. I believe that everything else that I wrote is correct, though.
Gold,
In Greeley’s case, the electors voted for a dead man. Such voted aren’t valid.
In your case, the candidate was alive at the time that the votes were cast. Thus, the votes are validly cast and should be counted by Congress.
Regarding the Baca SCOTUS case, there has to be some statutory clause that allows the winning or losing candidate to release a pledged Elector to vote for someone else.
Ex., in a 269-269 tie, someone will want to vote to determine the 3rd person eligible in the House. (2016: Colin Powell’s 3 votes put him into the hypothetical House contingent vote.)