PA has 72 delegates of which 54 are unpledged. 40 of those 54 though pledged to support whoever won their district or supported Trump anyways. So that’s where CNN is adding in another 40 on top of the 17 delegates awarded to the state wide winner of PA.
In Pennsylvania I matched the Trump and Cruz lists tovthe names in green papers and got 39, so CNN says 40? pretty close as to the ‘unbound’.