Have Appreciated Stock?

Assume you bought shares of stock 20 years ago that have appreciated. If you sell the shares, you might pay up to 23.8% Federal tax on their gain if you are in a high tax bracket. Consider gifting those appreciated shares to your child who is in a lower tax bracket so that child can sell them and pay tax at a 0% capital gains rate? This works as long as the child is not your dependent (i.e., that child is over age 18 or age 23 (if still in college)). This strategy also works when a retired parent or charity is the recipient of the gifted shares.