This is the mail archive of the 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] Fixes for duplicate warnings regressions [1/2]

On 11/25/2013 05:02 AM, Paolo Carlini wrote:
because then we don't warn *at all*. The reason being that with the
*first* cp_convert we end up calling c_common_truthvalue_conversion with
c_inhibit_evaluation_warnings bumped. The bumping happens in
cp_truthvalue_conversion. A mess, yes.

Perhaps cp_truthvalue_conversion should do something more specific to the actual warning it's trying to avoid.

At this Stage, if we don't feel
like going with something like my last try or something even less
straightforward reworking the way we bump c_inhibit_evaluation_warnings
in the various circumstances, I'm tempted to go back to my first try:

-      tree folded_result = cp_convert (type, folded, complain);
+      tree folded_result
+    = folded != expr ? cp_convert (type, folded, complain) : result;

Would it be safe? I mean, is it at all possible that folded == expr and
in fact we should call again cp_convert? Because otherwise it's also a
(minor) optimization and radically avoids the problem.

That's fine with me.


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