245A) in any taxable year, solely for purposes of determining loss on any disposition of stock of such foreign corporation in such taxable year or any subsequent taxable year, the basis of such domestic corporation in such stock shall be reduced (but not below zero) by the amount of any deduction allowable to such domestic corporation under section 245A with respect to such stock except to the extent such basis was reduced under section 1059 by reason of a dividend for which such a deduction was allowable. . (2) Effective date The amendments made by this subsection shall apply to distributions made after December 31, 2017. (b) Treatment of foreign branch losses transferred to specified 10-percent owned foreign corporations (1) In general Part II of subchapter B of chapter 1 is amended by adding at the end the following new section: 91. Certain foreign branch losses transferred to specified 10-percent owned foreign corporations (a) In general If a domestic corporation transfers substantially all of the assets of a foreign branch (within the meaning of section 367(a)(3)(C)) to a specified 10-percent owned foreign corporation (as defined in section 245A) with respect to which it is a United States shareholder after such transfer, such domestic corporation shall include in gross income for the taxable year which includes such transfer an amount equal to the transferred loss amount with respect to such transfer. (b) Transferred loss amount For purposes of this section, the term transferred loss amount means, with respect to any transfer of substantially all of the assets of a foreign branch, the excess (if any) of— (1) the sum of losses— (A) which were incurred by the foreign branch after December 31, 2017, and before the transfer, and (B) with respect to which a deduction was allowed to the taxpayer, over (2) the sum of— (A) any taxable income of such branch for a taxable year after the taxable year in which the loss was incurred and through the close of the taxable year of the transfer, and (B) any amount which is