(Resending because I forgot to CC cfe-commits.) On Fri, Jun 7, 2013 at 11:02 AM, Eli Friedman <[email protected]>wrote:
> On Sun, Jun 2, 2013 at 1:11 AM, David Majnemer > <[email protected]>wrote: > >> Author: majnemer >> Date: Sun Jun 2 03:11:22 2013 >> New Revision: 183084 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=183084&view=rev >> Log: >> Properly consider the range of enum for range comparisons in C mode >> >> In some cases, clang applies the C++ rules for computing the range of a >> value when said value is an enum. >> >> Instead, apply C semantics when in C mode. >> >> > With this patch, the following code triggers a -Wsign-conversion warning: > > enum X { a, b, c }; > > int f() { > > enum X x = b; > > return x; > } > > The warning is technically correct, but it doesn't seem appropriate. It's > not obvious what the right approach is to address this issue. Do you have > any suggestions? > > -Eli > >
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
