Edit: A lot of people say, that GWM needs a melee weapon attack, but they miss Jesses point: While GWM requires a melee attack with a heavy weapon, Sharpshooters only criteria is an attack with a ranged weapon (not a ranged weapon attack). Jesse bases his claim on the fact, that a crossbow is still a ranged weapon, even if used as an improvised weapon for melee combat. That’s why it deals 1d4(!)+20 damage. (It works with any ranged, heavy weapon btw., so Longbow qualifies too.) Of course Jesse is playing the devils advocate here and of course, no somewhat sane Walter will allow this in any campaign ever, as it’s obviously not the intention behind these feats. But you could read it that way and that’s Jesses (paperthin) point. Besides: he finds the image of a barbarian running around recklessly smashing a crossbow over everyone’s head to just be hilarious.
This doesn't really work as far as I can tell, RAW or RAI. While it is the case that in theory a Melee Attack with a Heavy Ranged Weapon would satisfy both criteria, there is no weapon that can normally perform such an attack, as far as I'm aware. Using a Heavy Crossbow or a Longbow to make a Melee Attack would be attacking with an Improvised Melee Weapon, which is both not a Ranged Weapon and does not have the Heavy property, so neither Feat would be useful.
If we are being generous we could say that attacking with a Heavy Crossbow would be like a Club and a Longbow would be like a Staff, and per the Improvised Weapons rules we could use those weapon stats for our Improvised Weapon, however, note that neither of these have the Heavy property, so you would be unable to use either Feat in this case as well. (The Heavy property, particularly on Ranged Weapons, seems to be not about the weight of the weapon (an intrinsic property of the thing), but about the strength required to attack with such a weapon in it's intended manner. In this way it would make sense that neither Feat would work.)
save