Check for empty expression in expr().

Fixes 2925.