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. Marek