Section 318 sets out the constructive ownership rules that treat stock owned by one person as owned by another for purposes of the Code provisions that apply them. These rules attribute ownership among family members, and between entities such as partnerships, estates, trusts, and corporations and their owners or beneficiaries. § 318(a).
This example illustrates an important limit. H, an individual, owns all of the stock of Corporation A. Corporation A is not considered to own the stock that H owns in Corporation A. In other words, a corporation is not treated as owning its own stock under section 318. Treas. Reg. § 1.318-2(a), Example 1.
The entity attribution rules run between a corporation and its shareholders, not from a shareholder back into the corporation as ownership of its own shares. Recognizing this boundary matters whenever section 318 is applied, for example in testing redemptions under section 302 or in determining related-party status.