such account before the child has attained the age of 18, shall be included in the gross income of the taxpayer, and subparagraph (A) of subsection (f) shall apply (relating to additional tax on distributions not used for qualified medical expenses). (ii) Age 18 and older Any amount paid or distributed out of such account after the child has attained the age of 18 may only be treated as used to pay qualified medical expenses to the extent such child is not covered as a dependent under insurance (other than permitted insurance) of a parent. (B) Exceptions for disability or death of child If the child becomes disabled within the meaning of section 72(m)(7) or dies— (i) subparagraph (A) shall not apply to any subsequent payment or distribution, and (ii) the taxpayer may rollover the amount in such account to an individual retirement plan of the taxpayer, to any health savings account of the taxpayer, or to any child health savings account of any other child of the taxpayer. (C) Health insurance may be purchased from account Subparagraph (B) of subsection (d)(2) shall not apply to any health savings account originally established as a child health savings account. (6) Regulations The Secretary shall prescribe such regulations as may be necessary to carry out the purposes of this subsection, including rules for determining application of this subsection in the case of legal guardians and in the case of parents of a child who file separately, are separated, or are not married. . (b) Effective date The amendments made by this section shall apply to taxable years beginning after December 31, 2017. 241. Allowing minimum distributions from tax-deferred retirement accounts to be deposited into HSAs (a) Transfer from retirement plan (1) Individual retirement accounts Section 408(d) is amended by adding at the end the following new paragraph: (10) Required minimum distribution transferred to health savings account (A) In general In the case of an individual who has attained the age of 70 ½ and who elects the application of