That would fall under the rules for "improvised weapons".
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.
He doesn't mean you are throwing the pike, whip, glaive, etc. He means you are using its 10 foot reach. Using the general statement that a melee weapon is used to attack someone within five feet and reasoning that if you attack someone outside of 5 feet makes the weapon ranged means you end up with what FarBeyondC mentioned - namely that a weapon with a 10 foot reach is now a ranged weapon if used to attack beyond 5 feet.
The statement about what constitutes a ranged weapon or melee weapon in the rules is a generalized statement with specific exceptions - and specific beats general, of course.
Some melee weapons can be thrown - but they're still melee weapons.
Some melee weapons have a reach of 10 ft - but they are still melee weapons.
Ranged weapons can be fired within 5 ft. - but they are still ranged weapons (just used at disadvantage - generally. Unless you have the specific exception of the Crossbow Expert feat).