sizeof accepts a type or an expression as its input, so it would compile successfully if expr were a type but not a valid expression (say, int).