Can I use Whirlwind or King's Edict to target Baron?

Yes — both can hit Baron Nashor.

Neither spell targets or "chooses" units itself. Whirlwind and King's Edict both instruct players to make choices during resolution, and per Rule 355.10.e those player-made choices are not targeting. Since Baron's protection only blocks being chosen by enemy spells and abilities (not by players resolving them), he's a legal choice for both (FAQ #10445, #509, #8959). In a 1v1, King's Edict means your opponent simply must pick Baron and he gets killed.

FAQ #12061August 6, 2026