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: C++ PATCH to abate shift warnings (PR c++/68979)


On Tue, Jan 12, 2016 at 08:27:47AM -0500, Jason Merrill wrote:
> Changing the diagnostic is OK, but cxx_eval_check_shift_p should return true
> regardless of flag_permissive, so that SFINAE results follow the standard.

There's a complication, because if I keep returning true, we'll give a
compile-time error like this:

permissive-1.C:5:18: warning: left operand of shift expression â(-1 << 4)â is
negative [-fpermissive]
 enum A { AA = -1 << 4 }; // { dg-warning "operand of shift expression" "" {
target c++11 } }

permissive-1.C:5:21: error: enumerator value for âAAâ is not an integer
constant
 enum A { AA = -1 << 4 }; // { dg-warning "operand of shift expression" "" {
target c++11 } }

So I suppose that wouldn't really help.  :(

	Marek


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