Per the SRD:
To determine whether your target has cover from your ranged attack, choose a corner of your square. If any line from this corner to any corner of the target’s square passes through a square or border that blocks line of effect or provides cover, or through a square occupied by a creature, the target has cover (+4 to AC).
When making a melee attack against an adjacent target, your target has cover if any line from any corner of your square to the target’s square goes through a wall (including a low wall). When making a melee attack against a target that isn’t adjacent to you (such as with a reach weapon), use the rules for determining cover from ranged attacks.
Emphasis mine. Whip, as a reach weapon, uses ranged attack rules for cover, and ranged rules give +4 AC if there is a creature between attacker and the target.