Jakub Jelinek wrote:
> 2009-03-09 Jakub Jelinek <[email protected]>
> PR c++/39371
> * semantics.c (finish_switch_cond): Don't call get_unwidened.
> * decl.c (finish_case_label): Pass SWITCH_STMT_TYPE as 3rd argument
> instead of TREE_TYPE (cond).
> * g++.dg/opt/switch2.C: Add -w to dg-options.
> * g++.dg/warn/Wswitch-1.C: Adjust expected warnings.
> * g++.dg/warn/switch1.C: New test.
> * g++.dg/other/switch3.C: New test.
I've always been suspicious of this code. I agree that the FE shouldn't
be modifying the types of expressions in this way. I suspect that it
used to be profitable in some situation, but it really shouldn't be anymore.
But, Jason might have more context. So, I'll approve this, assuming
that Jason doesn't object within 24 hours.
(650) 331-3385 x713