Re: [C++ Patch] Tweak check_previous_goto_1 to emit hard errors instead of permerrors in some cases
On 08/09/2018 08:07 AM, Paolo Carlini wrote: Hi, over the years we reworked and improved the code in decl.c checking gotos quite a bit. Lately, in some specific unsafe cases, identify_goto issues upfront an error instead of a permerror, whereas it used to always issue a permerror. Over the last weeks a few colleagues of mine noticed that we don't do that, escalating a permerror to a plain error, in a case which is certainly unsafe - decl_jump_unsafe returns 2 - thus, if the user passes -fpermissive we end up emitting assembly completely missing labels. The straightforward patchlet below passes testing on x86_64-linux. Thanks, Paolo. / ok, thanks -- Nathan Sidwell
Re: [C++ Patch] Tweak check_previous_goto_1 to emit hard errors instead of permerrors in some cases
.. an additional clarification (I told you that over the years we changed this code quite a bit...): I originally added the testcase that I'm adjusting here, I did that when, back in 2014, I worked on 63558: the test uses -fpermissive -w and was meant to check, as requested by Manuel in the bug, that we didn't issue further unsuppressible explanatory diagnostic after the primary permerror. I would argue that that first clean-up back 2014 was an improvement but note that, in practice, before it we rejected (with a confusing permerror + error) this kind of broken code and we don't anymore. That's bad. We don't really emit sensible assembly for it, as I already explained. Paolo.