This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/12242] g++ should warn about out-of-range int->enum conversions
- From: "manu at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Aug 2008 07:50:40 -0000
- Subject: [Bug c++/12242] g++ should warn about out-of-range int->enum conversions
- References: <bug-12242-702@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #16 from manu at gcc dot gnu dot org 2008-08-07 07:50 -------
The expression cannot be very complicated because it needs to be a INTEGER_CST.
On the other hand, I agree that it is best to give users as much information as
reasonable. I think it is better if you comment in gcc-patches so reviewers can
see your proposal. I would prefer to not repeat twice %T, though. Also, I think
users are going to have trouble to understand that the range of the enumeral is
larger than the number of enumerators it contains. Perhaps we should print the
range of %T?
"the result of %<static_cast%> is unspecified because %qE is outside the range
[%d,%d] of type %qT."
--
manu at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|gdr at gcc dot gnu dot org |manu at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12242