Yes Improvised Weapons used in melee are actually melee weapons
If they don't qualify as a weapon to start with then they are only weapons while the attack has been made.
Analysis
There are five basic things we need to unpack to answer this question:
- What is a weapon?
- What is a melee weapon?
- Are Improvised Weapons actually weapons?
- What is an Improvised Weapon?
- Can Improvised Weapons be melee weapons?
What is a weapon?
Objects specifically designated as weapons are obviously weapons and they are always weapons, even if they don't meet any other criteria in the basic definition.
This is an example of the Specific Beats General rule.
If a specific rule contradicts a general rule, the specific rule wins.
For all other objects we need some criteria to assess this. The PHB page 14 lays out the basic defintion of a weapon:
For each weapon your character wields, calculate the modifier you use when you attack with the weapon and the damage you deal when you hit.
When you make an attack with a weapon, you roll a d20 and add your proficiency bonus (but only if you are proficient with the weapon) and the appropriate ability modifier.
So for something to be a weapon there are three conditions that need to be met
- You need to be able to wield it
- You need to be able to attack with it (and the method for doing so is that you roll a d20 and add relevant modifiers)
- It needs to cause damage when it hits
We can use this later on to help with determining if an improvised weapon is a weapon.
What is a melee weapon?
The PHB Page 146 gives us our definition to answer this:
Every weapon is classified as either melee or ranged. A melee weapon is used to attack a target within 5 feet of you, whereas a ranged weapon is used to attack a target at a distance.
So if it is a weapon, and it is used to attack a target within 5 feet of you, then for that attack it counts as a melee weapon.
Are Improvised Weapons actually weapons?
The PHB page 147 has a section on Improvised Weapons:
Sometimes characters don't have their weapons and have to attack with whatever is close at hand. An improvised weapon includes any object you can wield in one or two hands, such as broken glass, a table leg, a frying pan, a wagon wheel, or a dead goblin.
In many cases, an improvised weapon is similar to an actual weapon and can be treated as such.
...
An object that bears no resemblance to a weapon deals 1d4 damage (the DM assigns a damage type appropriate to the object). 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. An improvised thrown weapon has a normal range of 20 feet and a long range of 60 feet.
So lets apply our weapon criteria to this:
Thus an improvised weapon is a weapon.
What is an improvised weapon?
PHB pages 147 - 148:
An improvised weapon includes any object you can wield
...
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.
This passage gives us the definition:
- Any object being used as a weapon which is not normally a weapon (which you can wield)
- A melee weapon being used as a thrown weapon
- A ranged weapon being used as a melee weapon
Can Improvised Weapons be melee weapons?
If an Improvised Weapon is being used as a weapon, and it is being used in melee combat, to make a melee attack, it is a melee weapon.
The PHB Page 146 gives us two definitions to answer this:
Every weapon is classified as either melee or ranged.
So once something is a weapon (even for a second) it is either a melee weapon or a ranged weapon.
A melee weapon is used to attack a target within 5 feet of you, whereas a ranged weapon is used to attack a target at a distance.
A melee weapon is defined by how it is used, so if you are using an Improvised Weapon to make a melee attack,it counts as a weapon for the attack, it is being used to make a melee attack, therefore it is a melee weapon for that attack.
Bonus Questions
Is an Improvised Weapon, to steal a phrase, Schroedinger's Weapon?
Or phrased another way, is an improvised weapon a weapon only when you attack with it?
Yes, provided it doesn't already count as a weapon prior to the attack
The act of attacking with it and having the potential to cause damage with it is what causes a non-weapon object to fit the criteria for a weapon and turns a non-weapon object into a weapon (for the attack). After that attack is over it reverts to being a non-weapon object.
The corrolary to this is if you are using a proper weapon for a purpose that it was not designed. It remains a weapon for the duration, but while the attack is occuring it is an Improvised Weapon.
PHB pages 147 - 148:
An improvised weapon includes any object you can wield
...
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.
Do all weapons have to cause damage?
No
The Net entry in the PHB is aan example of a weapon that doesn't cause damage.
It is also a good example of the Specific Beats General rule.
The general rule is that a weapon has to have the ability to cause damage to be a weapon. The Net entry in the Weapons table creates an exception to this rule.