On Mon, 3 May 2021, Eric Botcazou wrote: > > So - what is it? Are pure functions allowed to throw or not? > > We keep going back to this every N years and I'm not sure why... In Ada the > answer is definitely yes, we have entire library units marked Pure and thus > containing bunch of pure functions but they can throw like any other function.
OK, so then we definitely have all the latent issues I paper over with the patch and that isn't even enough. Do you have extra fixes in your tree or does -fnon-call-exceptions somehow magically paper over the issue? I suppose if the C or C++ frontends like to have pure/const attributed functions not throw they could mark functions accordingly themselves. Which also means, the Ada functions are DECL_PURE_P but not 'pure' according to the extend.texi documentation of the user-visible attribute? That said, I think if my C++ testcase is valid then we should amend this documentation (or if not then as well, to not re-iterate this every N years). Do you agree? Thanks, Richard.