In the popular vernacular, a two-door sedan is defined by appearance and not by volume; vehicles with a B-pillar between the front and rear windows are generally called two-door sedans, while hardtops (without the pillar, and often incorporating a sloping backlight) are called coupés.
And while the M3 does have a frameless front door, it does have B pillars.