On Monday 26 August 2024 15:47:10 GMT-7 Ville Voutilainen wrote:
> On Mon, 26 Aug 2024 at 22:29, Giuseppe D'Angelo via Development
> 
> <development@qt-project.org> wrote:
> > Il 26/08/24 19:56, Thiago Macieira ha scritto:
> > > I'd like to request Qt code not obey that rule. In my opinion, it's a
> > > defect in the contract implementation rather than on Qt code. The*pre* 
> > > condition indicates something that must be true before the method is
> > > called and therefore the method's own noexcept specification does not
> > > apply*yet*.> 
> > As far as I've understood, that's only part of the issue. The other part
> > of the issue is that code calling the function may break: if you turn
> > the failed precondition check into an exception, the exception handling
> > will need to bubble it up through code which may not have set up the
> > correct unwinding state -- because it rightfully assumed that no
> > exception would escape out of a noexcept function.
> 
> A contract violation turned into an exception cannot escape out of a
> noexcept function. So it won't bubble up.

I think that's a mistake, but since I don't use exceptions, I also don't care. 
Don't use the violations-become-exceptions mode or do accept that that turns 
into a std::terminate().

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Principal Engineer - Intel DCAI Platform & System Engineering

Attachment: smime.p7s
Description: S/MIME cryptographic signature

-- 
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development

Reply via email to