C++ Logo


Advanced search

Re: [wg14/wg21 liaison] C++ res.on.exception.handling and POSIX function signatures

From: Florian Weimer <fweimer_at_[hidden]>
Date: Mon, 09 Nov 2020 09:07:53 +0100
* Hubert Tong via Liaison:

> It appears C++20 subclause [res.on.exception.handling]
> allows C standard library functions that are present in the C++
> standard library to be declared as being `noexcept(true)`; however,
> the same cannot be said of POSIX or LSB system interfaces.

Would you please elaborate your concern? Are you worried about missed
optimizations? Why does POSIX make a difference here?

The current C++ draft says this in the subclause you referenced:

| An implementation may strengthen the exception specification for a
| non-virtual function by adding a non-throwing exception specification.

Isn't this a mistake because it alters the types of those functions
since C++17?

The part about C standard library functions should probably removed
because it's just an optimization (and an optimization that is incorrect
for many C implementations).

Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill

Received on 2020-11-09 02:09:05