Forbid extern static from appearing in patterns

Fixes #16149.