On Wed, May 19, 2021 at 07:35:20PM +0100, Jonathan Wakely wrote:
> On 19/05/21 14:03 -0400, Marek Polacek wrote:
> > On Wed, May 19, 2021 at 11:51:54AM -0600, Martin Sebor via Gcc-patches 
> > wrote:
> > > On 5/19/21 10:39 AM, Jonathan Wakely via Gcc-patches wrote:
> > > > Jakub pointed out I'd forgotten the spaces before the opening parens
> > > > for function calls. The attached patch should fix all those, with no
> > > > other changes.
> > > >
> > > > Tested x86_64-linux. OK for trunk?
> > > 
> > > Looks good to me, it just needs an update to the manual describing
> > > the new options.
> > > 
> > > It's too bad that the conditionals checking for the dialect have
> > > to be repeated throughout the front end.  They're implied by
> > > the new option enumerator passed to pedwarn().  If the diagnostic
> > > subsystem had access to cxx_dialect the check could be done there
> > > and all the other conditionals could be avoided.  An alternative
> > > to that would be to add a new wrapper to the C++ front end, like
> > > cxxdialect_pedwarn, to do the checking before calling pedwarn
> > > (or, more likely, emit_diagnostic_valist).
> > 
> > In the C FE I introduced pedwarn_c11 and similar to deal with a similar
> > problem, and also handle the rule that a more specific warning overrides
> > more general warnings.
> 
> The C++ FE does already have pedwarn_cxx98, but generalizing that
> would have taken more effort than I wanted to spend on this, sorry :-(

No worries, that's understandable.  I think the patch is a good improvement
as-is.  (Though some doc text into the doc/invoke.texi should be added.)

Marek

Reply via email to