http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59231

--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Paolo Carlini from comment #6)
> However, what Jason suggested at the time was "ANOTHER job for
> c_inhibit_evaluation_warning" (emphasis mine). In my mind that was important
> because I saw a clear consistency rationale in the fix. Before changing /
> reverting anything here, we should therefore audit all those uses and figure
> out which ones we want to remove and finally decide which replacement.
> Frankly, I'm not sure this is 4.9 material (whoever does the job ;)

Yes, I saw it as a consistency issue.  But now I think that was forcing
consistency between two importantly different cases: the purpose of
c_inhibit_evaluation_warning is to avoid warning about evaluation issues for
expressions that are not actually evaluated.  But a template instantiation is
not an unevaluated context, so it's a different case.  Furthermore, the
-Wtype-limits warning still makes sense even in unevaluated context, so it
shouldn't be conditional on that.

I agree that an audit is needed here; we might want to introduce a new counter
to indicate dependent context and suppress some warnings within templates.  I
think this could still go into 4.9 if there's time to take care of it soon.

Reply via email to