The relevant text for Spiritual Weapon is:
You create a floating, spectral weapon within range that lasts for the duration or until you cast this spell again. When you cast the spell, you can make a melee spell attack against a creature within 5 feet of the weapon. On a hit, the target takes force damage equal to 1d8 + your spellcasting ability modifier.
As a bonus action on your turn, you can move the weapon up to 20 feet and repeat the attack against a creature within 5 feet of it.
It's clear to me that the one attacking, is the one using the bonus action, i.e. the caster (despite the ambiguous use of the word 'attacker', see this Q&A).
I'm trying to figure out, which if any of the conditions listed in the basic rules, either prevent or impede the 'attacker' from using the bonus action. For instance:
Charmed: A charmed creature can't attack the charmer or target the charmer with harmful abilities or magical effects.
It sounds like you would classify the creature using it's bonus action this way as an attack, and/or spectral weapon as either a harmful ability or magical effect that would target the charmer, right?
But 'Frightened' says 'The creature can't willingly move closer to the source of its fear.' which sounds like it wouldn't prevent the spectral weapon approaching?
Which if any of these conditions prevent or impede the afflicted caster from being able to attack with Spiritual Weapon? Are any different than if the afflicted caster made a normal melee weapon attack?