Re: [C++ Patch] PR 63265

2014-11-11 Thread Paolo Carlini
Hi, On 11/10/2014 06:16 PM, Jason Merrill wrote: I don't think we want to suppress this warning in general. The problem in this PR is that the warning code is failing to recognize that the first operand is constant false. Thanks. Then, shall we do something like the below? Passes testing.

Re: [C++ Patch] PR 63265

2014-11-11 Thread Jason Merrill
On 11/11/2014 08:04 AM, Paolo Carlini wrote: - tree cond = RECUR (TREE_OPERAND (t, 0)); + tree cond + = maybe_constant_value (fold_non_dependent_expr_sfinae + (RECUR (TREE_OPERAND (t, 0)), tf_none)); I like this approach, but if the result of

Re: [C++ Patch] PR 63265

2014-11-11 Thread Paolo Carlini
Hi, On 11/11/2014 02:19 PM, Jason Merrill wrote: On 11/11/2014 08:04 AM, Paolo Carlini wrote: -tree cond = RECUR (TREE_OPERAND (t, 0)); +tree cond + = maybe_constant_value (fold_non_dependent_expr_sfinae + (RECUR (TREE_OPERAND (t, 0)), tf_none)); I like this

Re: [C++ Patch] PR 63265

2014-11-11 Thread Jason Merrill
OK. Jason

Re: [C++ Patch] PR 63265

2014-11-11 Thread Paolo Carlini
Hi, On 11/11/2014 04:03 PM, Jason Merrill wrote: OK. Committed. What about 4.9? Technically the issue is a regression, but in my opinion the fix isn't completely trivial for a release branch.. Paolo.

Re: [C++ Patch] PR 63265

2014-11-11 Thread Jason Merrill
On 11/11/2014 12:37 PM, Paolo Carlini wrote: Committed. What about 4.9? Technically the issue is a regression, but in my opinion the fix isn't completely trivial for a release branch.. I think it's safe enough for a regression fix. Jason

[C++ Patch] PR 63265

2014-11-10 Thread Paolo Carlini
Hi, as far as I can see this 4.9/5 regression, where we spuriously warn about the left shifts in the templates, has to do with r208183, where Jason replaced c_inhibit_evaluation_warnings fiddling in tsubst_copy_and_build with two warning_sentinels, on warn_type_limits and warn_div_by_zero.

Re: [C++ Patch] PR 63265

2014-11-10 Thread Jakub Jelinek
On Mon, Nov 10, 2014 at 05:32:49PM +0100, Paolo Carlini wrote: PR c++/63265 * c-family/c.opt ([Wshift-count-negative, Wshift-count-overflow]): Add. Note, c-family/ has its own ChangeLog. Jakub

Re: [C++ Patch] PR 63265

2014-11-10 Thread Jason Merrill
On 11/10/2014 12:16 PM, Jason Merrill wrote: I don't think we want to suppress this warning in general. The problem in this PR is that the warning code is failing to recognize that the first operand is constant false. But adding the warning options is OK. Jason

Re: [C++ Patch] PR 63265

2014-11-10 Thread Jason Merrill
I don't think we want to suppress this warning in general. The problem in this PR is that the warning code is failing to recognize that the first operand is constant false. Jason

Re: [C++ Patch] PR 63265

2014-11-10 Thread Paolo Carlini
Hi, On 11/10/2014 06:16 PM, Jason Merrill wrote: On 11/10/2014 12:16 PM, Jason Merrill wrote: I don't think we want to suppress this warning in general. The problem in this PR is that the warning code is failing to recognize that the first operand is constant false. But adding the warning