However, the capital loss will be denied if you or an “affiliated person” acquire the same property or an identical property within the period that begins 30 days before you sold the property and ends 30 days after that, and you or the affiliated person owns that property at the end of the period. This is the “superficial loss” rule.
The one upside of the rule is that the cost of the property for the person acquiring the property (whether that is you or someone else) is bumped up by the amount of your loss that was denied under the rule.
An affiliated person includes your spouse or common-law partner, a corporation that you control, among others. Interestingly, it does not include your children or other relatives.