(#11331) Add validation that CASE does not produce an r-value.

This was missing in the validator.
Test example added.