At least in the US, if you donate the shares of stock, and not sell, pay the taxes and then donate, both the charity and you are much better off.
The charity gets the full value of the donated shares (any charity worth its salt has a policy that they immediately sell any stock that they receive - not taking any market risk). You get the full value of the stock as a charitable donation (subject to your income and carryover rules) and you don't have to pay any capital gains taxes. In addition, if the person is donating 10,000 shares (worth today $20M) then most probably they would be over the estate tax limit and save additional potential estate tax. If you are in a high tax bracket, this could mean that not only does the charity receive the full value of the stock donation, but you could be saving 40% or more in future estate taxes, as well as getting federal and state income tax deductions (current limit is 30% of AGI if contribution is securities and not cash, with carryover allowed for 5 years). If you are donating and have large pretax IRAs, this would be a very good time to convert to a Roth IRA, since you can shield a good portion of the income tax you would have to pay with the tax deduction from the contribution.
Tax accountants and other experts, please correct me or make additional comments.
I know, but he preferred to do it this way, don't know the details: