Re: C++ PATCH to abate shift warnings (PR c++/68979)

2016-01-12 Thread Jason Merrill
OK. Jason

Re: C++ PATCH to abate shift warnings (PR c++/68979)

2016-01-12 Thread Marek Polacek
On Tue, Jan 12, 2016 at 09:09:38AM -0500, Jason Merrill wrote: > In that case, we need to return (!flag_permissive || ctx->quiet). Thanks. So is this one ok once it passes testing? Bootstrapped/regtested on x86_64-linux, ok for trunk? 2016-01-12 Marek Polacek PR c++/68979 *

Re: C++ PATCH to abate shift warnings (PR c++/68979)

2016-01-12 Thread Jason Merrill
On 01/12/2016 09:05 AM, Marek Polacek wrote: 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

Re: C++ PATCH to abate shift warnings (PR c++/68979)

2016-01-12 Thread Marek Polacek
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-

Re: C++ PATCH to abate shift warnings (PR c++/68979)

2016-01-12 Thread Jason Merrill
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. Jason

Re: C++ PATCH to abate shift warnings (PR c++/68979)

2016-01-12 Thread Marek Polacek
On Tue, Jan 12, 2016 at 02:02:16PM +0100, Jakub Jelinek wrote: > On Tue, Jan 12, 2016 at 01:52:01PM +0100, Marek Polacek wrote: > > --- gcc/testsuite/g++.dg/warn/permissive-1.C > > +++ gcc/testsuite/g++.dg/warn/permissive-1.C > > @@ -0,0 +1,8 @@ > > +// PR c++/68979 > > +// { dg-do compile } > > +/

Re: C++ PATCH to abate shift warnings (PR c++/68979)

2016-01-12 Thread Jakub Jelinek
On Tue, Jan 12, 2016 at 01:52:01PM +0100, Marek Polacek wrote: > --- gcc/testsuite/g++.dg/warn/permissive-1.C > +++ gcc/testsuite/g++.dg/warn/permissive-1.C > @@ -0,0 +1,8 @@ > +// PR c++/68979 > +// { dg-do compile } > +// { dg-options "-fpermissive -Wno-shift-overflow -Wno-shift-count-overflow >

C++ PATCH to abate shift warnings (PR c++/68979)

2016-01-12 Thread Marek Polacek
Seems that people find compile-time error on the following testcase overly pedantic. I.e. that "enum A { X = -1 << 1 };" should compile, at least with -fpermissive. So I've changed the error_at into permerror and the return value of cxx_eval_check_shift_p now depends on flag_permissive. Luckily,