This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH to abate shift warnings (PR c++/68979)
- From: Marek Polacek <polacek at redhat dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 12 Jan 2016 15:05:52 +0100
- Subject: Re: C++ PATCH to abate shift warnings (PR c++/68979)
- Authentication-results: sourceware.org; auth=none
- References: <20160112125201 dot GE25528 at redhat dot com> <5694FF53 dot 1060305 at redhat dot com>
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