This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PR 12242 g++ should warn about out-of-range int->enum conversions


This patch fixes PR 12242 by warning for unspecified behaviour.

Bootstrapped and regression tested on x86_64-pc-linux-gnu wit
--enable-languages=all.

OK for trunk?

2008-08-07  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

  PR 12242
cp/
  * typeck.c (buld_static_cast_1): Warn for out-of-range conversions to enum.
testsuite/
  * g++.dg/warn/pr12242.C: New.

Attachment: fix-pr12242.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]