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]

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


Manuel López-Ibáñez wrote:

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.

I like the idea of this warning, but should this go in the conversion machinery in general, rather than in the build_static_cast_1 function? For example, do we (with -fpermissive) allow implicit conversion from integers to enums? If we do, then we would need this check in a more central location.


Thanks,

--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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