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.)
As far as I can see, the rule for using a ranged weapon for melee is just: “If a character uses a ranged weapon to make a melee attack, or throws a melee weapon that does not have the thrown property, it also deals 1d4 damage.” That says nothing about changing the traits of the weapon, nor that the weapon is treated as an improvised weapon for the purposes of the attack- the rules for improvised weapons are a seperate clause within the same paragraph. As such, I’d argue that hitting someone with the butt of your heavy crossbow is effectively an attack with a martial weapon, damage 1d4 bludgeoning, with the traits Ammunition (range 100/400), heavy, loading and two-handed- of which ammunition doesn’t apply because it’s not a ranged attack, and thus loading doesn’t constrain multiattack (because only being able to load 1 piece of ammo per round doesn’t affect the bonks per round). Per the thrown weapon rules, I’d also argue that bonking people with a crossbow would rely on the attacker’s dex, because it doesn’t have the finesse property and as a ranged weapon it’s dex based.
Was with you until your final point. Per the “Ability Modifiers” section of Attack Rolls in chapter 9, making a melee weapon attack uses Strength. The only exception to this is weapons that have finesse, which the crossbow does not. And despite this being an attack with a ranged weapon, you are using it as a melee weapon attack.
Ah, my mistake there- I thought that was another one with “attack with a melee weapon”. It does make more sense that crossbow bashing would be strength based tho, surprising to see the rules as written following logic XD