We have a client who installed solar on his primary residence in 2018. He replaced the entire roof on his home and believes that a portion of that roof replacement would qualify for the credit. Per the solar contractor, the roof had to be replaced in order to have solar panels installed on top of it. See below from the contractor. It seems that the IRS is not explicit in either allowing or disallowing the roof costs for the credit.
“Our records show that you had a weathered slate roof, which solar cannot be installed on. This leads me to believe that in order to go solar, your roof had to be replaced.”